Created
May 23, 2015 13:14
-
-
Save Xowap/0367ec320596c7219c51 to your computer and use it in GitHub Desktop.
Get minimum ping time for different ping counts
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/bash | |
function quickping { | |
sudo ping -s 200 -i 0.1 -c $2 $1 | tail -n 1 | grep -oE '[\.0-9]+' | head -n 1 | |
} | |
target=$1 | |
max=$2 | |
for i in `seq 1 $max`; | |
do | |
cnt=$(( $i * 10 )) | |
echo -n "$cnt," | |
quickping $target $cnt | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment