From 04ec79a37e95876e7e1ea270730e4e46515e5f0c Mon Sep 17 00:00:00 2001 From: TessaiMusa <49408514+TessaiMusa@users.noreply.github.com> Date: Wed, 20 Oct 2021 20:48:21 +0530 Subject: [PATCH] changed from strings to vars and fixed some more issues --- archfi | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/archfi b/archfi index 3968e19..4a28830 100644 --- a/archfi +++ b/archfi @@ -739,7 +739,7 @@ installmenu(){ options=() #options+=("${txtselectmirrorsbycountry}" "(${txtoptional})") options+=("${txteditmirrorlist}" "(${txtoptional})") - options+=("Filter mirrorlist" "Reflector") + options+=("${txtfiltermirrorlist}" "reflector") options+=("${txtinstallarchlinux}" "pacstrap") options+=("${txtconfigarchlinux}" "") sel=$(whiptail --backtitle "${apptitle}" --title "${txtinstallmenu}" --menu "" --cancel-button "${txtunmount}" --default-item "${nextitem}" 0 0 0 \ @@ -755,8 +755,8 @@ installmenu(){ ${EDITOR} /etc/pacman.d/mirrorlist nextitem="${txtinstallarchlinux}" ;; - "Filter mirrorlist") - rankmirrorlist + "${txtfiltermirrorlist}") + filtermirrorlist nextitem="${txtinstallarchlinux}" ;; "${txtinstallarchlinux}") @@ -794,25 +794,27 @@ selectmirrorsbycountry() { sed "s/^\(Server .*\)/\#\1/;/^## $country/N; {s/^\(## .*\n\)\#Server \(.*\)/\1Server \2/}" < /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist } -rankmirrorlist() { +filtermirrorlist() { command -v reflector > /dev/null || { echo "pacman -S --noconfirm reflector" pacman -S --noconfirm reflector } options=() options+=("Filter mirrorlist" "") - options+=("Edit /etc/xdg/reflector/reflector.conf" "") + options+=("${txtedit//%1/reflector.conf}" "") sel=$(whiptail --backtitle "${apptitle}" --title "${txtinstallmenu}" --menu "" --cancel-button "${txtback}" --default-item "Filter mirrorlist" 0 0 0 \ "${options[@]}" \ 3>&1 1>&2 2>&3) case ${sel} in - "Filter mirrorlist") + "${txtfiltermirrorlist}") + clear echo "systemctl start reflector.service" systemctl start reflector.service pressanykey ;; - "Edit /etc/xdg/reflector/reflector.conf") + "${txtedit//%1/reflector.conf}") ${EDITOR} /etc/xdg/reflector/reflector.conf + filtermirrorlist ;; esac } @@ -1921,6 +1923,7 @@ loadstrings(){ txtselectmirrorsbycountry="Select mirrors by country" txtselectcountry="Select country" txteditmirrorlist="Edit mirrorlist" + txtfiltermirrorlist="Filter mirrorlist" txtinstallarchlinux="Install Arch Linux" txtinstallarchlinuxkernel="Kernel" txtinstallarchlinuxfirmwares="Firmwares"