Difference between revisions of "Finding the fastest mirror"

From Alpine Linux
Jump to: navigation, search
m (remove the mkdir)
 
(One intermediate revision by one other user not shown)
Line 2: Line 2:
  
 
{{Cat|/home/user/fastestmirror|<nowiki>
 
{{Cat|/home/user/fastestmirror|<nowiki>
wget -q -O /tmp/MIRRORS.txt http://rsync.alpinelinux.org/alpine/MIRRORS.txt
 
L=$(cat /tmp/MIRRORS.txt)
 
 
 
data=""
 
data=""
for s in $L; do
+
for s in $(wget -qO- http://rsync.alpinelinux.org/alpine/MIRRORS.txt); do
         t=$(time -f "%E" wget -q $s/MIRRORS.txt -O /tmp/MIRRORS.txt 2>&1)
+
         t=$(time -f "%E" wget -q $s/MIRRORS.txt -O /dev/null 2>&1)
 
         echo "$s was $t"
 
         echo "$s was $t"
 
         data="$data$t $s\n"
 
         data="$data$t $s\n"
Line 16: Line 13:
 
echo -e $data | sort
 
echo -e $data | sort
 
</nowiki>}}
 
</nowiki>}}
 +
 +
 +
[[Category:Package Manager]]

Latest revision as of 14:41, 13 September 2019

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

Contents of /home/user/fastestmirror

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