With this winter weather my ISP service can go to crap some days. I'm a very amateur BASH script butcherer and I decided to put something together to record my connection down-time. Here's what I've got so far. It seems to work OK. So far today my WIFI has dropped for a brief second or so three times. I tossed the script onto my wife's PC and I'll check it later to see how it does on her's. I'm on an ASUS laptop with WIFI only and my wife is on an All-In_One on just ethernet.
Anyone see any problems with this or ways to do it better or to make this work better?
Code:
while [ 1 ]
do
wget -q --spider 'https://www.google.com/'
status=$?
# 0 is UP, 4 is DOWN
[ $status -eq 4 ] && TIME_NOW=`date -R` && echo " DOWN $TIME_NOW" >> ""${HOME}"/Bash_Scripts/IP-Up-Down_Time.log"
sleep 5
done;