summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2008-10-26 12:34:56 -0400
committerMicah Anderson <micah@riseup.net>2008-10-26 12:34:56 -0400
commit20e88948f035c56d51f07c53de50b75df57fc816 (patch)
treeb949e026bbf3687f05c1d98e1e22d9f9c0d31f62 /src
parent5722f3ce688ce4f71a7f3a4a3aa3d070c3e47014 (diff)
parenteef5c546af5f7a723be67303feee9b05b47b0fdb (diff)
Merge commit 'dkg/master'
Diffstat (limited to 'src')
-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