Skip to content

Instantly share code, notes, and snippets.

@s7anley
Last active September 28, 2015 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s7anley/e05bd26b3de3b7b22320 to your computer and use it in GitHub Desktop.
Save s7anley/e05bd26b3de3b7b22320 to your computer and use it in GitHub Desktop.
Is up?
#!/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