Tuesday, April 21, 2015

Monitor network on MacOS with

If you would like to test network connection on your macbook macos, you can run a script, which would say verbally when network is down. Just run this script in one of your terminal window, and it will tell you "Timeout" when internet is down. The script runs continuously. You have to stop it (Ctrl-Z) when you do not need to run it anymore.

Here is the script:

#!/bin/bash
echo begin ping
while :
do
if ping -c 5 8.8.8.8 | grep timeout;
then echo `say "Timeout"`;
else echo `echo "internet is back up"`;
time
fi
done

No comments:

Post a Comment