CODE:bsyLinux联盟
#!/bin/bashbsyLinux联盟bsyLinux联盟if [ $# != 1 -a "$1" != "hoary" -a "$1" != "breezy" ] ; thenbsyLinux联盟 echo "$0 (hoary|breezy)"bsyLinux联盟 exit 1bsyLinux联盟fibsyLinux联盟bsyLinux联盟echo "Seting $1 ..."bsyLinux联盟MIRRORS="http://ftp.iinet.net.au/pub/ubuntu/ \bsyLinux联盟http://mirror.optus.net/ubuntu/ \bsyLinux联盟http://mirror.isp.net.au/ftp/pub/ubuntu/ \bsyLinux联盟http://www.planetmirror.com/pub/ubuntu/ \bsyLinux联盟http://ftp.filearena.net/pub/ubuntu/ \bsyLinux联盟http://mirror.pacific.net.au/linux/ubuntu/ \bsyLinux联盟http://ubuntu.inode.at/ubuntu/ \bsyLinux联盟http://ubuntu.uni-klu.ac.at/ubuntu/ \bsyLinux联盟http://gd.tuwien.ac.at/opsys/linux/ubuntu/archive/ \bsyLinux联盟http://ftp.belnet.be/pub/mirror/ubuntu.com/ \bsyLinux联盟http://ubuntu.mirrors.skynet.be/pub/ubuntu.com/ \bsyLinux联盟http://mirror.freax.be/ubuntu/archive.ubuntu.com/ \bsyLinux联盟http://espelhos.edugraf.ufsc.br/ubuntu/ \bsyLinux联盟http://ubuntu.interlegis.gov.br/archive/ \bsyLinux联盟http://ubuntu.c3sl.ufpr.br/ubuntu/ \bsyLinux联盟http://mirror.cpsc.ucalgary.ca/mirror/ubuntu.com/ \bsyLinux联盟http://mirror.arcticnetwork.ca/pub/ubuntu/packages/ \bsyLinux联盟http://archive.ubuntu.org.cn/ubuntu/ \bsyLinux联盟http://debian.cn99.com/ubuntu/ \bsyLinux联盟http://mirror.lupaworld.com/ubuntu/ \bsyLinux联盟http://ftp.ucr.ac.cr/ubuntu/ \bsyLinux联盟http://archive.ubuntu.cz/ubuntu/ \bsyLinux联盟http://ubuntu.supp.name/ubuntu/ \bsyLinux联盟http://mirrors.dk.telia.net/ubuntu/ \bsyLinux联盟http://mirrors.dotsrc.org/ubuntu/ \bsyLinux联盟http://klid.dk/homeftp/ubuntu/ \bsyLinux联盟http://ftp.estpak.ee/pub/ubuntu/ \bsyLinux联盟http://www.nic.funet.fi/pub/mirrors/archive.ubuntu.com/ \bsyLinux联盟http://mir1.ovh.net/ubuntu/ubuntu/ \bsyLinux联盟http://fr.archive.ubuntu.com/ubuntu/ \bsyLinux联盟http://ftp.u-picardie.fr/pub/ubuntu/ubuntu/ \bsyLinux联盟http://ftp.oleane.net/pub/ubuntu/ \bsyLinux联盟http://debian.charite.de/ubuntu/ \bsyLinux联盟http://ftp.inf.tu-dresden.de/os/linux/dists/ubuntu \bsyLinux联盟http://www.artfiles.org/ubuntu.com \bsyLinux联盟http://ftp.rz.tu-bs.de/pub/mirror/ubuntu-packages/ \bsyLinux联盟http://www.ftp.uni-erlangen.de/pub/mirrors/ubuntu/ \bsyLinux联盟http://debian.tu-bs.de/ubuntu \bsyLinux联盟http://ftp.ntua.gr/pub/linux/ubuntu/ \bsyLinux联盟http://ftp.kfki.hu/linux/ubuntu/ \bsyLinux联盟http://komo.vlsm.org/ubuntu/ \bsyLinux联盟http://kambing.vlsm.org/ubuntu/ \bsyLinux联盟http://ubuntu.odg.cc/ \bsyLinux联盟http://ubuntu.lhi.is/ \bsyLinux联盟http://ftp.esat.net/mirrors/archive.ubuntu.com/ \bsyLinux联盟http://ftp.heanet.ie/pub/ubuntu/ \bsyLinux联盟http://ftp.linux.it/ubuntu/ \bsyLinux联盟http://na.mirror.garr.it/mirrors/ubuntu-archive/ \bsyLinux联盟http://ubuntu.mithril-linux.org/archives/ \bsyLinux联盟http://mirror.letsopen.com/os/ubuntu/ \bsyLinux联盟http://ftp.kaist.ac.kr/pub/ubuntu/ \bsyLinux联盟http://ubuntu-arch.linux.edu.lv/ubuntu/ \bsyLinux联盟http://ftp.litnet.lt/pub/ubuntu/ \bsyLinux联盟http://nl.archive.ubuntu.com/ubuntu/ \bsyLinux联盟http://ubuntu.synssans.nl \bsyLinux联盟http://www.computacion.uni.edu.ni/iso/ubuntu/ \bsyLinux联盟http://no.archive.ubuntu.com/ubuntu/ \bsyLinux联盟http://ubuntulinux.mainseek.com/ubuntu/ \bsyLinux联盟http://ubuntu.task.gda.pl/ubuntu/ \bsyLinux联盟http://darkstar.ist.utl.pt/ubuntu/archive/ \bsyLinux联盟http://ubuntu.dcc.fc.up.pt/ \bsyLinux联盟http://ftp.iasi.roedu.net/mirrors/ubuntulinux.org/ubuntu/ \bsyLinux联盟http://ftp.lug.ro/ubuntu/ \bsyLinux联盟http://debian.nsu.ru/ubuntu/ \bsyLinux联盟http://ftp.acc.umu.se/mirror/ubuntu/ \bsyLinux联盟http://mirror.switch.ch/ftp/mirror/ubuntu/ \bsyLinux联盟http://apt.ubuntu.org.tw/ubuntu/ \bsyLinux联盟http://apt.nc.hcc.edu.tw/pub/ubuntu/ \bsyLinux联盟http://ubuntu.csie.ntu.edu.tw/ubuntu/ \bsyLinux联盟http://ftp.cse.yzu.edu.tw/ftp/Linux/Ubuntu/ubuntu/ \bsyLinux联盟http://godel.cs.bilgi.edu.tr/mirror/ubuntu/ \bsyLinux联盟http://www.mirror.ac.uk/mirror/archive.ubuntu.com/ubuntu/ \bsyLinux联盟http://ubuntu.blueyonder.co.uk/archive/ \bsyLinux联盟http://mirror.cs.umn.edu/ubuntu/ \bsyLinux联盟http://lug.mtu.edu/ubuntu/ \bsyLinux联盟http://mirror.clarkson.edu/pub/distributions/ubuntu/ \bsyLinux联盟http://ubuntu.mirrors.tds.net/ubuntu/ \bsyLinux联盟http://www.opensourcemirrors.org/ubuntu/ \bsyLinux联盟http://ftp.ale.org/pub/mirrors/ubuntu/ \bsyLinux联盟http://ubuntu.secs.oakland.edu/ \bsyLinux联盟http://mirror.mcs.anl.gov/pub/ubuntu/ \bsyLinux联盟http://mirrors.cat.pdx.edu/ubuntu/ \bsyLinux联盟http://ubuntu.cs.utah.edu/ubuntu/ \bsyLinux联盟http://ftp.ussg.iu.edu/linux/ubuntu/ \bsyLinux联盟http://mirrors.xmission.com/ubuntu/ \bsyLinux联盟http://ftp.osuosl.org/pub/ubuntu/ \bsyLinux联盟http://mirrors.cs.wmich.edu/ubuntu/"bsyLinux联盟bsyLinux联盟TIME="/usr/bin/time -o timer.txt -f %e"bsyLinux联盟URL="dists/$1/main/binary-i386/Packages.gz"bsyLinux联盟WGET="wget --cache=off -T 20 -t 1 -w 0 -O /dev/null"bsyLinux联盟PAYTIME=1000bsyLinux联盟TEMPTIME=1000bsyLinux联盟bsyLinux联盟SITE="NONE"bsyLinux联盟bsyLinux联盟for mirror in $MIRRORS; dobsyLinux联盟 echo "Testing $mirror ..."bsyLinux联盟 TEMPTIME=$($TIME $WGET $mirror$URL)bsyLinux联盟 if [ "$?" = 0 ] ; thenbsyLinux联盟 TEMPTIME=$(cat timer.txt)bsyLinux联盟 echo "wget $1: $TEMPTIME CurrMinTime: $PAYTIME"bsyLinux联盟 TEMPTIME2=$(echo "$PAYTIME> $TEMPTIME"|bc)bsyLinux联盟 if [ $TEMPTIME2 = 1 ] ; thenbsyLinux联盟 PAYTIME=$TEMPTIMEbsyLinux联盟 SITE=$mirrorbsyLinux联盟 echo "Set best site($PAYTIME): $SITE"bsyLinux联盟 fibsyLinux联盟 fibsyLinux联盟 rm timer.txtbsyLinux联盟done