fix: do not return negative quotas
This commit is contained in:
@@ -87,7 +87,12 @@ get_total_quota_until_today(){
|
||||
}
|
||||
|
||||
get_remaining_quota(){
|
||||
echo -n $(($(get_total_quota_until_today) - $(get_current_used_bytes)))
|
||||
local remaining_quota=$(($(get_total_quota_until_today) - $(get_current_used_bytes)))
|
||||
if [ $remaining_quota -lt 0 ]; then
|
||||
echo 0
|
||||
else
|
||||
echo -n $remaining_quota
|
||||
fi
|
||||
}
|
||||
|
||||
show_remaining_quota(){
|
||||
|
||||
Reference in New Issue
Block a user