Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisTitusTech committed Jul 13, 2024
2 parents e3f3ead + f38c70f commit 15a70b5
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/commands/system-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ checkEnv() {


DTYPE="unknown" # Default to unknown
# Use /etc/os-release for modern distro identification
if [ -f /etc/os-release ]; then
source /etc/os-release
DTYPE=$ID
fi
# Use /etc/os-release for modern distro identification
if [ -f /etc/os-release ]; then
source /etc/os-release
DTYPE=$ID
fi

}

Expand All @@ -77,7 +77,13 @@ fastUpdate() {
fi
${AUR_HELPER} --noconfirm -S rate-mirrors-bin
sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
sudo rate-mirrors --top-mirrors-number-to-retest=5 --disable-comments --save /etc/pacman.d/mirrorlist --allow-root ${DTYPE}

# If for some reason DTYPE is still unknown use always arch so the rate-mirrors does not fail
local dtype_local=${DTYPE}
if [ ${DTYPE} == "unknown" ]; then
dtype_local="arch"
fi
sudo rate-mirrors --top-mirrors-number-to-retest=5 --disable-comments --save /etc/pacman.d/mirrorlist --allow-root ${dtype_local}
;;
apt-get|nala)
sudo apt-get update
Expand Down Expand Up @@ -129,4 +135,4 @@ updateSystem() {

checkEnv
fastUpdate
updateSystem
updateSystem

0 comments on commit 15a70b5

Please sign in to comment.