Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Queries Hughesnet modem for usage allowance information
- #Parses the info and displays the relevent information
- info=$(curl -silent http://www.systemcontrolcenter.com/getdeviceinfo/info.bin | grep -e ^Any -e ^Bonus)
- index=0
- for word in $info
- do
- amt="$(echo $word | tr -cd [:digit:]'\n')"
- mb[index]=$(echo "scale=2; $amt/1000" | bc)
- ((++index))
- done
- bold=$(tput bold)
- normal=$(tput sgr0)
- clear
- echo -e "${bold}\n**Hughesnet Status Monitor**"
- echo -e "${normal}\nAnytime data usage is from 8am - 2am"
- echo "---------------------------------------"
- echo "Anytime Data Allowance: "${mb[1]}"GB"
- echo "Anytime Data Remaining: "${mb[0]}"GB"
- echo "======================================="
- echo "Bonus bytes usage is from 2am - 8am"
- echo "---------------------------------------"
- echo "Bonus Bytes Allowance: "${mb[3]}"GB"
- echo -e "Bonus Bytes Remaining: "${mb[2]}"GB"
- tt=$(curl -silent http://www.systemcontrolcenter.com/getdeviceinfo/info.bin | grep -e ^User -e ^TimeLeft)
- index1=0
- for word1 in $tt
- do
- amt="$(echo $word1 | tr -cd [:digit:]'\n')"
- tito[index1]=$amt
- ((++index1))
- done
- time=$(echo "scale=0; (${tito[0]}/60)/24" | bc)
- token=$(echo "scale=2; ${tito[1]}/1000" | bc)
- anyMB=$(echo "scale=0; ${mb[0]}*1000" | bc)
- dailyUse=$(echo "scale=0; $anyMB/$time" | bc)
- echo "======================================="
- echo "Token Bytes Available: "$token"GB"
- echo -e "Days Until Refill: "$time
- echo -e "Safe Anytime Data Usage Per Day: "$dailyUse"MB"'\n\n'
- read -p "Press any key to close..." -n1 -s
- echo -e "\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement