From 8eace382f96acfb22ab30b9622557beafb12f08b Mon Sep 17 00:00:00 2001 From: Tony Fahrion Date: Thu, 29 Jun 2017 13:22:08 +0200 Subject: [PATCH] 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 ! --- scripts/get | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/get b/scripts/get index 012b99013..748b0015c 100755 --- a/scripts/get +++ b/scripts/get @@ -50,7 +50,7 @@ initOS() { runAsRoot() { local CMD="$*" - if ! whoami | egrep -q '^root$'; then + if [ $EUID -ne 0 ]; then CMD="sudo $CMD" fi