DEBUG mode will overrule running as root

Either DEBUG mode set, and the script will run, no matter it's not running as root.
This commit is contained in:
Søren Theilgaard
2021-12-01 22:31:48 +01:00
parent 49470cdfdd
commit b885fdb742

View File

@@ -58,7 +58,7 @@ versionKey="CFBundleShortVersionString"
currentUser=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ { print $3 }')
# MARK: check for root
if [[ "$(whoami)" != "root" && "$DEBUG" -ne 2 ]]; then
if [[ "$(whoami)" != "root" && "$DEBUG" -eq 0 ]]; then
# not running as root
cleanupAndExit 6 "not running as root, exiting"
fi