Skip to content

Instantly share code, notes, and snippets.

@poppen
Last active August 29, 2015 14:18
Show Gist options
  • Save poppen/f129cf2d4bdb046adef5 to your computer and use it in GitHub Desktop.
Save poppen/f129cf2d4bdb046adef5 to your computer and use it in GitHub Desktop.
#!/bin/bash
IP_ADDR=$1
while true; do
sleep 1
result=`/sbin/ping -q -c 1 $IP_ADDR 2>&1`
if [ $? -eq 2 ]; then
echo $result
terminal-notifier -message "packet to ${IP_ADDR} is lost!"
exit
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment