24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-12 21:52:07 +02:00

ejabberdctl: Use $INSTALLUSER's home directory

Make sure ejabberdctl uses the $INSTALLUSER's .erlang.cookie file even
if the script was executed by root.
This commit is contained in:
Holger Weiss 2014-07-24 15:25:28 +02:00
parent a087af7060
commit 43000d9ce4

View File

@ -22,7 +22,8 @@ if [ "$INSTALLUSER" != "" ] ; then
EXEC_CMD="false"
for GID in `id -G`; do
if [ $GID -eq 0 ] ; then
EXEC_CMD="su $INSTALLUSER -p -c"
INSTALLUSER_HOME=$(getent passwd "$INSTALLUSER" | cut -d: -f6)
EXEC_CMD="env HOME=$INSTALLUSER_HOME su $INSTALLUSER -p -c"
fi
done
if [ `id -g` -eq `id -g $INSTALLUSER` ] ; then