summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2008-10-25 14:17:50 -0400
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2008-10-25 14:17:50 -0400
commitbb75d35fb6705d8a75b88af30274703ca84d45f2 (patch)
treeb8237db51e8bc8ed53eeba436fb7f3d7d0298634
parent5f29ad789dda115b477d53fbedd3a71b64962e27 (diff)
parent504dc4666e1d327b82c985a88da6e208c8348e81 (diff)
Merge commit 'jrollins/master'
-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