summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-03-22 23:00:47 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-03-22 23:00:47 +0300
commitf1b81898ef75bb8a6df927bb9167ccdf28366e7f (patch)
tree3259ba241897f163cb866461321d29a2155c08e0
parent7491c24ff24688cb13067289d817fd7e9adb0610 (diff)
e3372-stats: fix invalid variable names, code style fixes
-rwxr-xr-xe3372-stats.sh18
1 files changed, 7 insertions, 11 deletions
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 "<CurrentUpload>" | sed -e 's/<[^>]*>//g')
-
-
CurrDownload=$(cat modem_status.xml | grep "<CurrentDownload>" | sed -e 's/<[^>]*>//g')
-
TotalUpload=$(cat modem_status.xml | grep "<TotalUpload>" | sed -e 's/<[^>]*>//g')
-
TotalDownload=$(cat modem_status.xml | grep "<TotalDownload>" | sed -e 's/<[^>]*>//g')
-
TotalConnectTime=$(cat modem_status.xml | grep "<TotalConnectTime>" | 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