From 6e2d57610ee45d9a3337a101a18e0cee4059c88d Mon Sep 17 00:00:00 2001 From: frlan Date: Tue, 4 Oct 2011 22:37:38 +0200 Subject: [PATCH] Show correct value left/needs to be contributed for reactivating full bandwith and how much 'money' is left. --- src/traffic_status | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/traffic_status b/src/traffic_status index 4fc5f2c..26c3ff7 100755 --- a/src/traffic_status +++ b/src/traffic_status @@ -2,9 +2,15 @@ source $(dirname $0)/traffic_common.sh +balance=$((($TPer + $TEph - $TMax) / $BytesPerCent)) + echo -e \ "Consumed: $((($TPer + $TEph) / 1024 / 1024)) MB ($(($TPer / 1024 / 1024)) MB accounted to disk) -Limit: $(($TMax / 1024 / 1024)) MB +Limit: $(($TMax / 1024 / 1024)) MB" -Please donate $(($(($TPer + TEph)) / $BytesPerCent)) cent." +if [ "$balance" -lt 0 ]; then + echo "There are $(($balance * -1 ))ct left" +else + echo "Please donate $balance cent." +fi