Commit 8eace382 authored by Tony Fahrion's avatar Tony Fahrion

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 !
parent 974c4b67
......@@ -50,7 +50,7 @@ initOS() {
runAsRoot() {
local CMD="$*"
if ! whoami | egrep -q '^root$'; then
if [ $EUID -ne 0 ]; then
CMD="sudo $CMD"
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment