From 720cfd75b2fd0758446594c479f6b15030b06e46 Mon Sep 17 00:00:00 2001 From: velvettear Date: Mon, 28 Oct 2024 13:57:14 +0100 Subject: [PATCH] fix script to be posix compliant --- scripts/update/update.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/update/update.sh b/scripts/update/update.sh index a0c4d81..d3eeff5 100755 --- a/scripts/update/update.sh +++ b/scripts/update/update.sh @@ -8,16 +8,16 @@ distro="$(grep "^ID" /etc/*release | cut -d "=" -f2)" script="$(dirname $(realpath $0))/$distro.sh" # check if update script exists -[[ ! -x "$script" ]] && printf "error: update script '"$script"' does not exist or is not executable!\n" >&2 && exit 1 +[ ! -x "$script" ] && printf "error: update script '"$script"' does not exist or is not executable!\n" >&2 && exit 1 args="" for arg in "$@"; do - [[ -n "$args" ]] && args="$args " + [ -n "$args" ] && args="$args " args="$args$arg" done # execute update script -if [[ "$EUID" == "0" ]]; then +if [ "$(id -u)" -eq 0 ]; then "$script" $args else sudo "$script" $args