summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/monkeysphere-server11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/monkeysphere-server b/src/monkeysphere-server
index d3ba5e4..0c56279 100755
--- a/src/monkeysphere-server
+++ b/src/monkeysphere-server
@@ -66,8 +66,17 @@ subcommands:
EOF
}
+# function to run command as monkeysphere user
su_monkeysphere_user() {
- su "$MONKEYSPHERE_USER" -c "$@"
+ # if the current user is the monkeysphere user, then just eval
+ # command
+ if [ $(id -un) = "$MONKEYSPHERE_USER" ] ; then
+ eval "$@"
+
+ # otherwise su command as monkeysphere user
+ else
+ su "$MONKEYSPHERE_USER" -c "$@"
+ fi
}
# function to interact with the host gnupg keyring