From 9d912f5fee92e40276bca1349ef8a224c0e2fd32 Mon Sep 17 00:00:00 2001 From: velvettear Date: Tue, 5 Nov 2024 15:43:50 +0100 Subject: [PATCH] fix update script for archlinux --- scripts/update/arch.sh | 3 +++ scripts/update/update.sh | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/update/arch.sh b/scripts/update/arch.sh index 9bf229f..6546d6e 100755 --- a/scripts/update/arch.sh +++ b/scripts/update/arch.sh @@ -25,6 +25,9 @@ for arg in "$@"; do esac done +# sudo +sudo id -u 2&> /dev/null + printf "${BOLD}${YELLOW}>> starting system update...${DEFAULT}\n" # upgrade installed packages diff --git a/scripts/update/update.sh b/scripts/update/update.sh index d3eeff5..e1b8f58 100755 --- a/scripts/update/update.sh +++ b/scripts/update/update.sh @@ -17,8 +17,11 @@ for arg in "$@"; do done # execute update script -if [ "$(id -u)" -eq 0 ]; then - "$script" $args +#if [ "$distro" == "arch" ]; then +# "$script" $args +if [ "$(id -u)" -eq 0 ] || [ "$distro" == "arch" ]; then +#elif [ "$(id -u)" -eq 0 ]; then + "$script" $args else sudo "$script" $args fi