fix script to be posix compliant
This commit is contained in:
parent
aa4d8b6c64
commit
720cfd75b2
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue