Finding the fastest mirror

From Alpine Linux
Revision as of 01:27, 22 February 2018 by Orson Teodoro (talk | contribs) (Create page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

After you install Alpine, you may be wondering how do I figure out the fastest mirror again?

Contents of /home/user/fastestmirror

mkdir ~/.tmp wget -q -O ~/.tmp/MIRRORS.txt http://rsync.alpinelinux.org/alpine/MIRRORS.txt L=$(cat /tmp/MIRRORS.txt) data="" for s in $L; do t=$(time -f "%E" wget -q $s/MIRRORS.txt -O ~/.tmp/MIRRORS.txt 2>&1) echo "$s was $t" data="$data$t $s\n" done echo "===RESULTS===" echo -e $data | sort