Date: Mon, 5 May 2003 14:14:20 -0400 From: Leo Bicknell <bicknell@ufp.org> To: Kirk Strauser <kirk@strauser.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Periodic email about security notifications Message-ID: <20030505181420.GA88863@ussenterprise.ufp.org> In-Reply-To: <87llxl4ce0.fsf@pooh.honeypot.net> References: <20030504100447.GU12792@freepuppy.bellavista.cz> <200305042336.h44NaoM7023683@gw.catspoiler.org> <20030504235059.GB42024@isnic.is> <20030505001955.GB92114@opiate.soulwax.net> <87r87d5vfg.fsf@pooh.honeypot.net> <87u1c94epk.fsf@pooh.honeypot.net> <20030505153116.GC74924@freepuppy.bellavista.cz> <87llxl4ce0.fsf@pooh.honeypot.net>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
In a message written on Mon, May 05, 2003 at 10:54:47AM -0500, Kirk Strauser wrote:
> There's nothing at all wrong with that. My goal, though was to
> automatically add that functionality to *every* program that would
> ordinarily connect to ftp.freebsd.org. With the exception of changing some
> default values, no programs would have to be modified to get the new
> rotating-mirror capability.
I'm sure there is a better way to do this, but I've used this script
before:
#!/bin/sh
(
for host in ftp1 ftp2 ftp3 ftp4 ftp5 ftp6 ftp7 ftp8 ftp9
do
MS=`ping -q -c 2 $host.freebsd.org | tail -1 | sed -e 's,.*= [0-9.]*/,,' -e 's,/.*,,'`
echo $MS | grep "0 packets received" > /dev/null 2>&1
if [ $? = 0 ]
then
echo "9999 $host.freebsd.org"
else
echo "$MS $host.freebsd.org"
fi
done
) | sort -n | head -1 | sed -e 's/.* //'
If say, ftpmirrors.freebsd.org returned CNAME's for all active
mirrors you could grab that with host or dig, pipe it into this
code, and output the "closest" (by network time anyway) server.
Make a file /etc/best_freebsd_mirror and make the ports run this
script if it isn't set, and otherwise run it once a week in cron
or something to catch updates.
Anyway, method aside, making it so the user doesn't have to do
anything, yet the load gets distributed and a "good", if not "the
best" server is picked would be a good thing.
--
Leo Bicknell - bicknell@ufp.org - CCIE 3440
PGP keys at http://www.ufp.org/~bicknell/
Read TMBG List - tmbg-list-request@tmbg.org, www.tmbg.org
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)
iD8DBQE+tqn8Nh6mMG5yMTYRAoZRAJsEgwCvDApnKMHCa4753NfLDDZ3hQCgggAN
cOs3Qa3SrS1q0VYlN7Q+l/M=
=OIoI
-----END PGP SIGNATURE-----
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030505181420.GA88863>
