Detect if we are root based on the effective uid instead of the username. 
Allows sysadmins to specifiy their own username if they want.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/82895908
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/82895908
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/82895908

Branch: refs/heads/internallb
Commit: 828959086c6e06aa1cd3cc16cae7ec36caf86d60
Parents: dac10ad
Author: Hugo Trippaers <[email protected]>
Authored: Wed Apr 10 14:57:56 2013 +0200
Committer: Alena Prokharchyk <[email protected]>
Committed: Wed Apr 10 15:44:05 2013 -0700

----------------------------------------------------------------------
 scripts/vm/systemvm/injectkeys.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/82895908/scripts/vm/systemvm/injectkeys.sh
----------------------------------------------------------------------
diff --git a/scripts/vm/systemvm/injectkeys.sh 
b/scripts/vm/systemvm/injectkeys.sh
index 49adfb3..c17a3c6 100755
--- a/scripts/vm/systemvm/injectkeys.sh
+++ b/scripts/vm/systemvm/injectkeys.sh
@@ -69,9 +69,9 @@ copy_priv_key() {
   return $?
 }
 
-if [[ `whoami` == cloud* ]]
+if [[ "$EUID" -ne 0  ]]
 then
-   SUDO=$SUDO
+   SUDO="sudo "
 fi
 
 $SUDO mkdir -p $MOUNTPATH

Reply via email to