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:
authornl6720 <nl6720@gmail.com>2022-12-06 14:20:30 +0200
committernl6720 <nl6720@gmail.com>2023-06-15 15:12:28 +0300
commit28a3a54c5f28e40a935609de9b092fe0c1cfee24 (patch)
treed65be4ebbacca79c995bc2ae8133455717be7352 /configs/releng/airootfs/usr/local/bin/choose-mirror
parent40dbfcfaf0a06a5c8e92a1d5183d8ae4e4634835 (diff)
Fix optional shellcheck warnings
Additionally fix a few code style issues found with shfmt.
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