From 444307193a3931ecdeceb209504ce6292dd64151 Mon Sep 17 00:00:00 2001 From: Tim Sedlmeyer Date: Wed, 11 Apr 2018 18:54:03 -0400 Subject: [PATCH] Use 'id -u' to check for root Root user is not always named root but is always uid 0 --- xo-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xo-install.sh b/xo-install.sh index 2566bda..46748be 100755 --- a/xo-install.sh +++ b/xo-install.sh @@ -14,7 +14,7 @@ function CheckUser { # Make sure the script is ran as root - if [[ ! $(whoami) == "root" ]]; then + if [[ ! "$(id -u)" == "0" ]]; then echo "This script needs to be ran as root" exit 0 fi