Home » Questions » Computers [ Ask a new question ]

Make a Mac sound an alarm when it can't ping a server?

Make a Mac sound an alarm when it can't ping a server?

Is there a way I can make a Mac Mini sound an audible alarm when it's not connected to the Internet?

Asked by: Guest | Views: 336
Total answers/comments: 1
Guest [Entry]

"The following loop will send a single ICMP ECHO request (ping) to your ISP and then sleep for a second. If a reply isn't received within two seconds, it will play the file alarm.wav.

YOUR_ISP=1.2.3.4
while :
do
ping -t 2 -o -c 1 $YOUR_ISP || open alarm.wav
sleep 1
done"