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

This commit is contained in:
Hugo Trippaers 2013-04-10 14:57:56 +02:00
parent 9fca393f01
commit 6bec37dc04

View File

@ -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