Skip to content

Instantly share code, notes, and snippets.

@mrspeaker
Created December 2, 2014 22:09
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 mrspeaker/0bbdaff3ee2a90e50078 to your computer and use it in GitHub Desktop.
Save mrspeaker/0bbdaff3ee2a90e50078 to your computer and use it in GitHub Desktop.
Save average ping times
#!/bin/sh
FN="tweetPing$(date +"%T" | sed 's/://g').txt"
echo $FN
while true
do
TIME=$(date +"%T")
# Ping returns:
# round-trip min/avg/max/stddev = 37.895/37.895/37.895/0.000 ms
# I'm sure there's a better way to pull out the avg, but this works eh...
PINGED=$(ping -c 10 www.twitter.com | grep avg | sed 's/.*=[^\/]*\///g' | sed 's/\/.*//g')
echo "$TIME $PINGED"
echo "$TIME $PINGED" >> $FN
sleep 60
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment