Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/configs/releng/airootfs/usr/local/bin/choose-mirror
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2024-05-10 15:20:28 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2024-05-10 15:20:28 +0200
commit04ce9be284db8fe4be3b6a7b77bdd31940d0fd7e (patch)
tree3ea7d489d1db5ed068bd202a462ba7b1543d1820 /configs/releng/airootfs/usr/local/bin/choose-mirror
parent702200a7b8aac8a18644ac4a0c52a4fca16099b2 (diff)
parente567a2ab268e340be608ac442eb13c54c566fbff (diff)
merged with upstream
Diffstat (limited to 'configs/releng/airootfs/usr/local/bin/choose-mirror')
-rwxr-xr-xconfigs/releng/airootfs/usr/local/bin/choose-mirror17
1 files changed, 9 insertions, 8 deletions
diff --git a/configs/releng/airootfs/usr/local/bin/choose-mirror b/configs/releng/airootfs/usr/local/bin/choose-mirror
index b021945..d2349de 100755
--- a/configs/releng/airootfs/usr/local/bin/choose-mirror
+++ b/configs/releng/airootfs/usr/local/bin/choose-mirror
@@ -4,21 +4,22 @@
get_cmdline() {
local param
- for param in $(< /proc/cmdline); do
+ for param in $(</proc/cmdline); do
case "${param}" in
- $1=*) echo "${param##*=}";
- return 0
- ;;
+ "${1}="*)
+ echo "${param##*=}"
+ return 0
+ ;;
esac
done
}
-mirror=$(get_cmdline mirror)
-[[ $mirror = auto ]] && mirror=$(get_cmdline archiso_http_srv)
-[[ $mirror ]] || exit 0
+mirror="$(get_cmdline mirror)"
+[[ "$mirror" == 'auto' ]] && mirror="$(get_cmdline archiso_http_srv)"
+[[ -n "$mirror" ]] || exit 0
mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.orig
-cat >/etc/pacman.d/mirrorlist << EOF
+cat >/etc/pacman.d/mirrorlist <<EOF
#
# Arch Linux repository mirrorlist
# Generated by archiso