Last active
September 28, 2015 08:56
-
-
Save s7anley/e05bd26b3de3b7b22320 to your computer and use it in GitHub Desktop.
Is up?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo 'Enter host you want to ping:'; | |
read PHOST; | |
if [[ "$PHOST" == "" ]]; then | |
exit; | |
fi | |
while true; | |
do | |
ping -c 1 $PHOST > /dev/null; | |
if [[ "$?" == 0 ]]; then | |
terminal-notifier -message " $PHOST is up" -title "Is up?" | |
exit | |
fi | |
sleep 5; | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment