Skip to content

Commit

Permalink
Get mirrors from https://www.archlinux.org/mirrorlist/ when not speci…
Browse files Browse the repository at this point in the history
…fied (#24)
  • Loading branch information
drizzt committed Nov 15, 2016
1 parent c164d4b commit 867d5c8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vps2arch
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ else
exit 2
fi

get_worldwide_mirrors() {
_download 'https://www.archlinux.org/mirrorlist/?country=all&protocol=http&protocol=https&ip_version=4' | awk '/^## /{if ($2 == "Worldwide") { flag=1 } else { flag=0 } } /^#Server/ { if (flag) { sub(/\/\$repo.*/, ""); print $3 } }'
}

cpu_type=$(uname -m)

is_openvz() { [ -d /proc/vz -a ! -d /proc/bc ]; }
Expand Down Expand Up @@ -321,7 +325,7 @@ while getopts ":b:m:n:h" opt; do
done
shift $((OPTIND - 1))

: ${mirrors:="http://mirror.rackspace.com/archlinux http://dgix.ru/mirrors/archlinux"}
[ -z "$mirrors" ] && mirrors=$(get_worldwide_mirrors)

if is_openvz; then
bootloader=none
Expand Down

0 comments on commit 867d5c8

Please sign in to comment.