Created
November 30, 2014 12:15
-
-
Save toshi0383/8fa3a07e516f58ee5db8 to your computer and use it in GitHub Desktop.
ポケットWifi(EMOBILE GL06P) の受信データ量合計を取得するシェル ref: http://qiita.com/toshi0383/items/8f7de60be27b51a77c81
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./wifilog.sh | |
[2014/11/30 20:59:36]: 308 GB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
00 * * * * ~/Settings/bin/wifilog.sh >> ~/Settings/log/wifi.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
URL="http://pocketwifi.home/api/monitoring/traffic-statistics" | |
downloadByte=`curl $URL 2> /dev/null \ | |
| grep TotalDownload \ | |
| sed -e "s/<TotalDownload>//g" -e "s~</TotalDownload>~~g"` | |
downloadGigaByte=`expr $downloadByte / 1024 / 1024 / 1024` #切り捨て御免 | |
echo "["`date "+%Y/%m/%d %H:%M:%S"`"]:" $downloadGigaByte "GB" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment