*sigh* I wish there was a better way...
10 Mar
2015
10 Mar
'15
6:53 p.m.
To find the closest and/or fastest CentOS mirror, a function which is sadly lacking from CentOS (at least as of v6), this is what I just hacked together. Documenting it here for posterity. (If you wanted to sort by RTT instead of hopcount, you could either reverse the order of i & t in the END block of the awk script, or figure out sort(1)'s ridiculous -k option.) #!/bin/sh printf 'Hops\tPing\tHost\n' for h in $( lynx -listonly -nonumbers -dump http://isoredirect.centos.org/centos/6/isos/x86_64/ | egrep '^https?://' | sed -e 's#^https*://\([^/]*\)/.*$#\1#' ); do mtr -c 1 -r $h | awk -v h=$h 'BEGIN {i=0;t=0} /^ *[0-9]*\./ {i++; t=$5} END {print i,t,h}' & done | sort -n | head -10 wait
4095
Age (days ago)
4095
Last active (days ago)
0 comments
1 participants
participants (1)
-
Adam Thompson