Skip to content

Instantly share code, notes, and snippets.

@Xowap
Created May 23, 2015 13:14
Show Gist options
  • Save Xowap/0367ec320596c7219c51 to your computer and use it in GitHub Desktop.
Save Xowap/0367ec320596c7219c51 to your computer and use it in GitHub Desktop.
Get minimum ping time for different ping counts
#!/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