Stop reflector.service
This commit is contained in:
parent
173e0c47d9
commit
1c5ec56e12
26
install.sh
26
install.sh
|
@ -362,7 +362,9 @@ setRootPassword() {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateMirrors() {
|
updateMirrors() {
|
||||||
whiptail --yesno "Would you like to update your mirrors by choosing your closest countries?" 0 0 || return
|
whiptail --msgbox "Now, we will update the mirror list by taking the most recently synchronized HTTPS mirrors sorted by download rate." 0 0
|
||||||
|
whiptail --yesno "Would you like to choose your closest countries to narrow the search?" 0 0
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
|
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
|
||||||
curl -o /etc/pacman.d/mirrorlist.pacnew https://archlinux.org/mirrorlist/all/ 2>&1 | debug
|
curl -o /etc/pacman.d/mirrorlist.pacnew https://archlinux.org/mirrorlist/all/ 2>&1 | debug
|
||||||
local IFS=$'\n'
|
local IFS=$'\n'
|
||||||
|
@ -371,7 +373,11 @@ updateMirrors() {
|
||||||
countries=$(whiptail --title "Countries" --checklist "" 0 0 0 "${options[@]}" 3>&1 1>&2 2>&3)
|
countries=$(whiptail --title "Countries" --checklist "" 0 0 0 "${options[@]}" 3>&1 1>&2 2>&3)
|
||||||
[ -z "$countries" ] && logAndExit "You must select at least one country." "updateMirrors"
|
[ -z "$countries" ] && logAndExit "You must select at least one country." "updateMirrors"
|
||||||
countriesFmt=$(echo "$countries" | sed -r 's/" "/,/g')
|
countriesFmt=$(echo "$countries" | sed -r 's/" "/,/g')
|
||||||
sudo reflector --country \"${countriesFmt//\"/}\" --protocol https --sort rate --save /etc/pacman.d/mirrorlist 2>&1 | debug
|
reflector --country \"${countriesFmt//\"/}\" --protocol https --sort rate --save /etc/pacman.d/mirrorlist 2>&1 | debug
|
||||||
|
else
|
||||||
|
reflector --protocol https --sort rate --latest 20 --save /etc/pacman.d/mirrorlist 2>&1 | debug
|
||||||
|
# checkForSystemdUnit "mirrors update" "reflector.service"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
grubSetUp() {
|
grubSetUp() {
|
||||||
|
@ -446,13 +452,15 @@ getDotfiles() {
|
||||||
chsh -s $(which zsh)
|
chsh -s $(which zsh)
|
||||||
}
|
}
|
||||||
|
|
||||||
checkForSystemdUnits() {
|
checkForSystemdUnit() {
|
||||||
trap 'systemctl stop reflector' INT
|
trap 'systemctl stop ${2}' INT
|
||||||
calcHeightAndRun "whiptail --infobox \"Waiting for systemd units to finish. In particular 'reflector.service' is the one that will take the longest. If you want to stop it, type Ctrl+C (note that the script will ask you later if you want to update the mirrors, so don't worry).\" HEIGHT 61"
|
# systemctl is-active --quiet ${2}
|
||||||
systemctl is-active --quiet graphical.target
|
# [ $? -eq 0 ] && return
|
||||||
|
calcHeightAndRun "whiptail --infobox \"Waiting for the ${1} to finish.\" 7 WIDTH"
|
||||||
|
systemctl is-active --quiet ${2}
|
||||||
while [ $? -ne 0 ]; do
|
while [ $? -ne 0 ]; do
|
||||||
sleep 1
|
sleep 1
|
||||||
systemctl is-active --quiet graphical.target
|
systemctl is-active --quiet ${2}
|
||||||
done
|
done
|
||||||
trap - INT
|
trap - INT
|
||||||
}
|
}
|
||||||
|
@ -512,7 +520,9 @@ runScript() {
|
||||||
if [ $i -gt 0 ]; then
|
if [ $i -gt 0 ]; then
|
||||||
welcomeMsg="Welcome back to CocoASAIS!"
|
welcomeMsg="Welcome back to CocoASAIS!"
|
||||||
else
|
else
|
||||||
checkForSystemdUnits
|
systemctl stop reflector.service
|
||||||
|
checkForSystemdUnit "systemd units" "graphical.target"
|
||||||
|
# systemctl start reflector.service
|
||||||
welcomeMsg="Welcome to CocoASAIS!"
|
welcomeMsg="Welcome to CocoASAIS!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue