Skip to content

Instantly share code, notes, and snippets.

@tbaschak
Last active August 29, 2015 14:02
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 tbaschak/20c216f03844de26a68d to your computer and use it in GitHub Desktop.
Save tbaschak/20c216f03844de26a68d to your computer and use it in GitHub Desktop.
#!/bin/bash
function usage ()
{
echo "Usage:"
echo " $0 <IP>"
echo "OR"
echo " $0 <IP> | tee mylog.txt"
}
if [ $# -ne 1 ]; then
usage
exit 127
fi
IP=$1
while :; do ping -c 1 -W 1 $IP >/dev/null || date; sleep 1; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment