Skip to content

Instantly share code, notes, and snippets.

@opie4624
Created October 15, 2012 21:27
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 opie4624/3895640 to your computer and use it in GitHub Desktop.
Save opie4624/3895640 to your computer and use it in GitHub Desktop.
#!/bin/bash
LOG=/tmp/netlog-$1
rm -f $LOG
while ( true );
do
ping -c1 -t 1 $1 > /dev/null
if [ "$?" -gt "0" ]; then
echo `date` " I am offline" | tee $LOG
traceroute -a $1 | tee $LOG
fi
sleep 5 ;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment