Created
September 13, 2014 02:52
-
-
Save vivisidea/0b17eb78be7c45d032f6 to your computer and use it in GitHub Desktop.
simple shell script to find the min-average ping rtt time from multiple ips
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 | |
# file: ping-shortest | |
# created by make-template :) | |
# vivi@2014-06-29_18:16:12 | |
ipfile=ips.txt | |
tmp=ping-ip-tmp.txt | |
while read IP; do | |
average=`ping -nq -w 1 -i 0.2 -c 3 $IP | grep rtt | cut -d '/' -f 5` | |
if [ "X$average" == "X" ]; then | |
continue | |
fi | |
echo $average $IP | |
done < $ipfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ping-shortest | sort -n