Created
July 31, 2011 23:58
-
-
Save skull-squadron/1117362 to your computer and use it in GitHub Desktop.
a tastier beverage
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
# ping with UTC time | |
pint(){ | |
local TIMEOUTOPT='W' | |
case "`uname -s`" in | |
Darwin) TIMEOUTOPT='t' ;; # -t (seconds) timeout for mac/bsd | |
Linux) TIMEOUTOPT='W' ;; # -W (seconds) timeout for linux | |
*) echo "pint() Unsupported system" ; return 1 ;; | |
esac | |
while true; do | |
echo -n "`date -u '+%FT%TZ'` ping $1 " | |
ping -c1 -${TIMEOUTOPT}1 $1 | grep '_[rs]eq' || echo | |
sleep 1 | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment