show countrycode

This commit is contained in:
Tobias Powalowski 2023-07-21 22:05:53 +02:00
parent 90dfc73037
commit 18ddf34ebf

View file

@ -9,7 +9,7 @@ _select_mirror() {
if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then
_dialog --infobox "Downloading latest mirrorlist..." 3 40
_COUNTRY="$(curl -s "http://ip-api.com/csv/?fields=countryCode")"
${_DLPROG} "https://www.archlinux.org/mirrorlist/?country=${_COUNTRY}&protocol=https&ip_version=4&ip_version=6&use_mirror_status=on" -O /tmp/pacman_mirrorlist.txt
${_DLPROG} "https://www.archlinux.org/mirrorlist/?country=${_COUNTRY}&protocol=http&protocol=https&ip_version=4&ip_version=6&use_mirror_status=on" -O /tmp/pacman_mirrorlist.txt
if grep -q '#Server = https:' /tmp/pacman_mirrorlist.txt; then
mv "${_MIRRORLIST}" "${_MIRRORLIST}.bak"
cp /tmp/pacman_mirrorlist.txt "${_MIRRORLIST}"