From f1b81898ef75bb8a6df927bb9167ccdf28366e7f Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Mon, 22 Mar 2021 23:00:47 +0300 Subject: e3372-stats: fix invalid variable names, code style fixes --- e3372-stats.sh | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'e3372-stats.sh') diff --git a/e3372-stats.sh b/e3372-stats.sh index f50f822..19f560a 100755 --- a/e3372-stats.sh +++ b/e3372-stats.sh @@ -7,21 +7,17 @@ curl -s -X GET "http://$MODEM_IP/api/webserver/SesTokInfo" > ses_tok.xml COOKIE=`grep "SessionID=" ses_tok.xml | cut -b 10-147` TOKEN=`grep "TokInfo" ses_tok.xml | cut -b 10-41` -curl -s -X GET "http://$MODEM_IP/api/monitoring/traffic-statistics" -H "Cookie: $COOKIE" -H "__RequestVerificationToken: $TOKEN" -H "Content-Type: text/xml" > modem_status.xml +curl -s -X GET "http://$MODEM_IP/api/monitoring/traffic-statistics" \ + -H "Cookie: $COOKIE" \ + -H "__RequestVerificationToken: $TOKEN" \ + -H "Content-Type: text/xml" > modem_status.xml CurConnTime=$(cat modem_status.xml | grep CurrentConnectTime | sed -e 's/<[^>]*>//g') - - CurrUpload=$(cat modem_status.xml | grep "" | sed -e 's/<[^>]*>//g') - - CurrDownload=$(cat modem_status.xml | grep "" | sed -e 's/<[^>]*>//g') - TotalUpload=$(cat modem_status.xml | grep "" | sed -e 's/<[^>]*>//g') - TotalDownload=$(cat modem_status.xml | grep "" | sed -e 's/<[^>]*>//g') - TotalConnectTime=$(cat modem_status.xml | grep "" | sed -e 's/<[^>]*>//g') #------------------------------ @@ -54,9 +50,9 @@ fi # Current Downloae #------------------------------ if [ $CurrDownload -lt 1024 ]; then - echo "Current Download : ${CurrDowbload}B" + echo "Current Download : ${CurrDownload}B" elif [ $CurrDownload -lt 1048576 ]; then - echo "Current Download : $((CurrDowbload/1024))KiB" + echo "Current Download : $((CurrDownload/1024))KiB" elif [ $CurrDownload -lt 1073741824 ]; then echo "Current Download : $((CurrDownload/1048576))MiB" else @@ -80,7 +76,7 @@ fi # Total Download #------------------------------ if [ $TotalDownload -lt 1024 ]; then - echo "Total Download : ${TotalDowbload}B" + echo "Total Download : ${TotalDownload}B" elif [ $TotalDownload -lt 1048576 ]; then echo "Total Download : $((TotalDownload/1024))KiB" elif [ $TotalDownload -lt 1073741824 ]; then -- cgit v1.2.3