Script to check the uptime of my ISP - I run this from a CRON job on a local box.
|# try 3 times - sometimes getting an initial DNS failure that clears up|
|while [ $COUNTER -lt 3 ]; do|
|ping -c 1 google.com &> /dev/null|
|if [ $? -ne 0 ]; then|
|echo "`date`: ping failed, isp is down!" >> /Users/aking/Dropbox/Temp/isp-ping-result.log|
|echo "`date`: ping failed, isp is down!" >> /Users/aking/Dropbox/Temp/isp-downtime.log|
|echo "`date`: ping succeeded." >> /Users/aking/Dropbox/Temp/isp-ping-result.log|