diff --git a/limitator b/limitator index f35afe8..33a52b8 100644 --- a/limitator +++ b/limitator @@ -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(){