Created
December 2, 2014 22:09
-
-
Save mrspeaker/0bbdaff3ee2a90e50078 to your computer and use it in GitHub Desktop.
Save average ping times
This file contains 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
#!/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