show countrycode

This commit is contained in:
Tobias Powalowski 2023-07-21 22:03:14 +02:00
parent baff5c9748
commit 90dfc73037
2 changed files with 2 additions and 2 deletions

View file

@ -15,7 +15,7 @@ _hwclock() {
_timezone () {
_SET_ZONE=""
if ping -c1 www.google.com &>/dev/null; then
_ZONE="$(curl -s http://ip-api.com/csv/?fields=timezone)"
_ZONE="$(curl -s "http://ip-api.com/csv/?fields=timezone")"
_SET_ZONE=1
fi
while [[ -z "${_SET_ZONE}" ]]; do

View file

@ -8,7 +8,7 @@ _select_mirror() {
## Download updated mirrorlist, if possible (only on x86_64)
if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then
_dialog --infobox "Downloading latest mirrorlist..." 3 40
_COUNTRY="$(curl -s http://ip-api.com/csv/?fields=countryCode)"
_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
if grep -q '#Server = https:' /tmp/pacman_mirrorlist.txt; then
mv "${_MIRRORLIST}" "${_MIRRORLIST}.bak"