Skip to content

Instantly share code, notes, and snippets.

@johndrinkwater
Created April 16, 2009 13:44
Show Gist options
  • Save johndrinkwater/96419 to your computer and use it in GitHub Desktop.
Save johndrinkwater/96419 to your computer and use it in GitHub Desktop.
#!/bin/sh
PING="/bin/ping"
ADDR="janeway.afternet.org"
DATA=`$PING -c10 -s500 $ADDR -q `
LOSS=`echo $DATA | awk '{print $18 }' | tr -d %`
echo $LOSS
if [ $LOSS = 100 ];
then
echo 0
else
echo $DATA | awk -F/ '{print $5 }'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment