Skip to content

Instantly share code, notes, and snippets.

@mustakimali
Last active November 18, 2018 14:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mustakimali/13475ffd3eb02b3c8f48167b73643bda to your computer and use it in GitHub Desktop.
Save mustakimali/13475ffd3eb02b3c8f48167b73643bda to your computer and use it in GitHub Desktop.
An unix shell script to display total transmitted data through your NowTV and Sky router (in the UK)
# An unix shell script to display total transmitted data through you NowTV router (in the UK),
# should work with Sky router with a little bit of modification
# Refresh every 2 seconds, press Ctrl+C to stop.
# Replace the `admin:nowtv` with the username:password of your NowTV router's admin credential if you've changed it.
while true; \
do \
curl --user admin:nowtv http://192.168.0.1/Now_TV_system.html 2>/dev/null \
| grep -ioE "(\d{4,})<\/td>" \
| grep -o '[0-9]*' \
| sed '/^\s*$/d' \
| awk '{print ($1*10)/1024/1024}' \
| tail -r \
| sed '4q;d' \
| awk '{print "Total transmitted data: "$1" GB"}'; \
sleep 2; \
done
# An unix shell script to display total transmitted data through you Sky router (in the UK),
# Refresh every 2 seconds, press Ctrl+C to stop.
# usage
# $ export SKY_PWD=<your sky password>
# $ curl https://gist.githubusercontent.com/mustakimali/13475ffd3eb02b3c8f48167b73643bda/raw/6e4d498a3dbdaf6bcdc383691bf24052189ba9c3/Sky_Total_Transmission.sh | bash
while true; \
do \
curl --user admin:$SKY_PWD http://192.168.0.1/sky_system.html 2>/dev/null \
| grep '<td>MER' \
| grep -o '[0-9]*' \
| head -1 \
| awk '{print ($1*10)/1024/1024}' \
| awk '{print "Total transmitted data: "$1" GB"}'; \
sleep 2; \
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment