[jpuyy@jpuyy-laptop allconf]$ cat tizi.sh
#/bin/bash
suffix='.heredance.com'
locations='jp1 jp2 jp3 us1 us2 us3 us4 us5 sg1 sg2 hk1 hk2 tw1 uk1'
result_file='/tmp/.result_array'
> $result_file
for location in $locations;
do
result=`ping -q -A -c 10 $location$suffix | grep received`
echo "$location$suffix $result" >> $result_file
done
cat $result_file | sort -r -n -k 5 -k 11
Leave a Reply