Subject: Very rough MASTER SITE sorter
To: None <>
From: David Maxwell <>
List: tech-pkg
Date: 06/19/1999 18:01:53
This could be a lot cleaner in a number of ways,
a) not use a /tmp file, perhaps
b) rewrite in sh instead of csh?

Basically, it's a csh script that takes a variable argument that
looks like a MASTER_SITES list, and pings each one and sorts the
list. (sorting by Max RTT)

Right now, it sends just 1 packet. You could raise that and it 
might be a bit more accurate, though for true accuracy, it
really ought to learn about packet loss, and maybe even try a
file transfer.

I tend to believe ping is the simplest fairly accurate way to
estimate which site is best.

Feel free to use this as you (anyone) see fit.


set atest="

foreach i ( $atest )
        set j=`echo $i | sed 's/^.*\/\///;s/\([^\/]*\).*/\1/'`
        ping -c1 -q $j | tail -1 | sed 's/^.*=//;s/^.*\/.*\/\(.*\)\/.*$/\1/;s/$/ '$j'/' >> /tmp/srt$$
grep -v 'packet loss' /tmp/srt$$ | sort -n && rm /tmp/srt$$

David Maxwell,| -->
(About an Amiga rendering landscapes) It's not thinking, it's being artistic!
					      - Jamie Woods