Last active
September 2, 2022 12:26
-
-
Save wilkart/e898d96c32a31cefab8c137f3723f2c1 to your computer and use it in GitHub Desktop.
OpenBSD fastest mirror
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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