From: Ian Kelling Date: Sun, 2 Sep 2018 23:56:53 +0000 (-0400) Subject: bugfix calling as nonroot user X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=commitdiff_plain;h=1eb98ea8d93b885c8dad3afbf26671609e02975f;hp=11a2db1a576e78f58af7f1e7e4c83422635b630d bugfix calling as nonroot user --- diff --git a/myfai-chboot-local b/myfai-chboot-local index 5140f68..d8d4846 100755 --- a/myfai-chboot-local +++ b/myfai-chboot-local @@ -1,5 +1,8 @@ #!/bin/bash # note, this script gets piped to bash, so cant cd to current dir + +[[ $EUID == 0 ]] || exec sudo "${BASH_SOURCE}" "$@" + set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR @@ -29,8 +32,6 @@ while [[ $1 == -* ]]; do esac done -[[ $EUID == 0 ]] || exec sudo "${BASH_SOURCE}" "$@" - e() { echo "$*" if ! "$@"; then