Reflector support

This commit is contained in:
TessaiMusa 2021-10-20 20:20:54 +05:30
parent 8ab0776267
commit d16fe3b9ef

28
archfi
View file

@ -739,6 +739,7 @@ installmenu(){
options=() options=()
#options+=("${txtselectmirrorsbycountry}" "(${txtoptional})") #options+=("${txtselectmirrorsbycountry}" "(${txtoptional})")
options+=("${txteditmirrorlist}" "(${txtoptional})") options+=("${txteditmirrorlist}" "(${txtoptional})")
options+=("Filter mirrorlist" "Reflector")
options+=("${txtinstallarchlinux}" "pacstrap") options+=("${txtinstallarchlinux}" "pacstrap")
options+=("${txtconfigarchlinux}" "") options+=("${txtconfigarchlinux}" "")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtinstallmenu}" --menu "" --cancel-button "${txtunmount}" --default-item "${nextitem}" 0 0 0 \ sel=$(whiptail --backtitle "${apptitle}" --title "${txtinstallmenu}" --menu "" --cancel-button "${txtunmount}" --default-item "${nextitem}" 0 0 0 \
@ -754,6 +755,10 @@ installmenu(){
${EDITOR} /etc/pacman.d/mirrorlist ${EDITOR} /etc/pacman.d/mirrorlist
nextitem="${txtinstallarchlinux}" nextitem="${txtinstallarchlinux}"
;; ;;
"Filter mirrorlist")
rankmirrorlist
nextitem="${txtinstallarchlinux}"
;;
"${txtinstallarchlinux}") "${txtinstallarchlinux}")
if(installbase) then if(installbase) then
nextitem="${txtconfigarchlinux}" nextitem="${txtconfigarchlinux}"
@ -789,6 +794,29 @@ selectmirrorsbycountry() {
sed "s/^\(Server .*\)/\#\1/;/^## $country/N; {s/^\(## .*\n\)\#Server \(.*\)/\1Server \2/}" < /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist sed "s/^\(Server .*\)/\#\1/;/^## $country/N; {s/^\(## .*\n\)\#Server \(.*\)/\1Server \2/}" < /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist
} }
rankmirrorlist() {
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")
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")
echo "systemctl start reflector.service"
systemctl start reflector.service
pressanykey
;;
"Edit /etc/xdg/reflector/reflector.conf")
${EDITOR} /etc/xdg/reflector/reflector.conf
;;
esac
}
installbase(){ installbase(){
pkgs="base" pkgs="base"
options=() options=()