fix update script for archlinux

This commit is contained in:
Daniel Sommer 2024-11-05 15:43:50 +01:00
parent 720cfd75b2
commit 9d912f5fee
2 changed files with 8 additions and 2 deletions

View file

@ -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

View file

@ -17,7 +17,10 @@ for arg in "$@"; do
done
# execute update script
if [ "$(id -u)" -eq 0 ]; then
#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