Skip to content

Instantly share code, notes, and snippets.

@wilkart
Last active September 2, 2022 12:26
Show Gist options
  • Save wilkart/e898d96c32a31cefab8c137f3723f2c1 to your computer and use it in GitHub Desktop.
Save wilkart/e898d96c32a31cefab8c137f3723f2c1 to your computer and use it in GitHub Desktop.
OpenBSD fastest mirror
#!/usr/bin/env bash
MIRRORS=$(curl -s https://www.openbsd.org/ftp.html | grep "href=\"https" | grep "nofollow" | awk -F\" '{print $2}')
declare LIST
for MIRROR in ${MIRRORS}; do
SPEED=`curl -w %{time_total} -s --connect-timeout 1 --output /dev/null ${MIRROR}/timestamp`
if [ "$?" == 0 ]; then
printf "$SPEED :: echo $MIRROR > /etc/installurl\n"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment