X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fmonkeysphere-server;h=0c562799a3355a09207c7023e0d1044a7eea5451;hb=74b446aef77a46302430ee8aac7124f40d9bf1b4;hp=d3ba5e44f788f5b768e355e01bff73639c294616;hpb=14fd73037386e107dd99bc5a42102e229619e53b;p=monkeysphere.git 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