Important thing first, the mirror http://openbsd.cs.fau.de/pub/OpenBSD/
seems to be down.

On Tue, 19 Jan 2016 22:19:42 -0600
Luke Small <[email protected]> wrote:

> I have a 500 line program I wrote that reads openbsd.org.ftp.html and
> scraps off the html and ftp mirrors, records them all without redundancies
> as http mirrors in memory and downloads the appropriate version and machine
> architecture's SHA256 in the package folder. It tests all the mirrors for
> time, one at a time and uses kqueue to kill any laggy ftp calls. It uses
> ftp() calls for all its networking, so it shouldn't be too much of a
> security issue I'd guess. It writes the top 8 mirrors into /etc/pkg.conf it
> erases all the installpath entries while leaving everything else in the
> file. It can run as an unprivileged user, but of course it won't rewrite
> /etc/pkg.conf
> -Luke N Small
My quick-n-dirty script[1] tells me as long as I use
a mirror geographically close to me, I'll be fine.
- time diff in same country between different mirrors <=10%
- time diff same server tested multiple times <=10%
- time diff local vs. halfway around the earth >100% to <300%


[1] pkg_ping.sh
#!/bin/sh
#usage: ./pkg_ping.sh uk
#to test all the uk servers.
TMPFILE=/tmp/pkg_ping.tmp
SHATMP=/tmp/pkg_ping.sha

if [ ! -f ${TMPFILE} ]
then
        ftp -o - http://www.openbsd.org/build/mirrors.dat |\
        grep -e ^GZ -e ^UH |\
        grep -B1 -e ^UH |\
        grep -e ^GZ -e ^UH |\
        cut -f 2- > ${TMPFILE}
fi

grep -A1 -e "^$1" ${TMPFILE} | grep http |\
while read line
do
        echo trying ${line}
        time ftp -o ${SHATMP} ${line}/snapshots/packages/amd64/SHA256
done

Reply via email to