Create a backup of mirrorlist only if needed

This commit is contained in:
hak8or 2017-11-15 00:28:55 -05:00
parent 13fb7a54bd
commit 9182863f9c
1 changed files with 4 additions and 2 deletions

View File

@ -36,8 +36,10 @@ pacman-key --populate archlinux > $LOGFILE 2>&1
# Setup mirrors, hardcoded for now. Could have been done with rankmirror # Setup mirrors, hardcoded for now. Could have been done with rankmirror
# with USA and worldwide mirrors but eh. # with USA and worldwide mirrors but eh.
echo "$TAGSTR Setting up mirror list" echo "$TAGSTR Setting up mirror list"
mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup > $LOGFILE 2>&1 if [[ -e /etc/pacman.d/mirrorlist ]]; then
cat <<- 'EOM05594313219813' > /etc/pacman.d/mirrorlist mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup # > $LOGFILE 2>&1
fi
cat <<- 'EOM05594313219813' > /etc/pacman.d/mirrorlist
# Server list generated by rankmirrors on 2017-11-03 # Server list generated by rankmirrors on 2017-11-03
## ##
## Arch Linux repository mirrorlist ## Arch Linux repository mirrorlist