improve check if we are root already - in scripts/get

$EUID is readonly, so it should be save to test against it.

Thanks for the tip @thomastaylor312 !
pull/2626/head
Tony Fahrion 8 years ago
parent 974c4b67c7
commit 8eace382f9

@ -50,7 +50,7 @@ initOS() {
runAsRoot() { runAsRoot() {
local CMD="$*" local CMD="$*"
if ! whoami | egrep -q '^root$'; then if [ $EUID -ne 0 ]; then
CMD="sudo $CMD" CMD="sudo $CMD"
fi fi

Loading…
Cancel
Save