25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-20 17:27:00 +01:00

* src/ejabberdctl.template: Added the ability to define the --config-dir option.

SVN Revision: 1681
This commit is contained in:
Mickaël Rémond 2008-11-23 16:41:50 +00:00
parent c2d81c59b6
commit cc858469ec

View File

@ -13,10 +13,6 @@ HOST=localhost
ERLANG_NODE=$NODE@$HOST
ERL=@erl@
INSTALLUSER=@installuser@
ETCDIR=@SYSCONFDIR@/ejabberd
EJABBERD_CONFIG_PATH=$ETCDIR/ejabberd.cfg
LOGS_DIR=@LOCALSTATEDIR@/log/ejabberd
SPOOLDIR=@LOCALSTATEDIR@/lib/ejabberd
# read custom configuration
EJABBERDCTL_CONFIG_PATH=$ETCDIR/ejabberdctl.cfg
@ -30,6 +26,7 @@ while [ $# -ne 0 ] ; do
case $PARAM in
--) break ;;
--node) ERLANG_NODE=$1; shift ;;
--config-dir) ETCDIR=$1 ; shift ;;
--config) EJABBERD_CONFIG_PATH=$1 ; shift ;;
--ctl-config) EJABBERDCTL_CONFIG_PATH=$1 ; shift ;;
--logs) LOGS_DIR=$1 ; shift ;;
@ -38,6 +35,20 @@ while [ $# -ne 0 ] ; do
esac
done
# Define ejabberd variable if they have not been defined from the command line
if [ "$ETCDIR" = "" ] ; then
ETCDIR=@SYSCONFDIR@/ejabberd
fi
if [ "$EJABBERD_CONFIG_PATH" = "" ] ; then
EJABBERD_CONFIG_PATH=$ETCDIR/ejabberd.cfg
fi
if [ "$LOGS_DIR" = "" ] ; then
LOGS_DIR=@LOCALSTATEDIR@/log/ejabberd
fi
if [ "$SPOOLDIR" = "" ] ; then
SPOOLDIR=@LOCALSTATEDIR@/lib/ejabberd
fi
# check the proper system user is used
ID=`id -g`
EJID=`id -g $INSTALLUSER`
@ -172,6 +183,7 @@ help ()
echo " live Start an ejabberd node in live (interactive) mode"
echo ""
echo "Optional parameters when starting an ejabberd node:"
echo " --config-dir dir Config ejabberd: $ETCDIR"
echo " --config file Config ejabberd: $EJABBERD_CONFIG_PATH"
echo " --ctl-config file Config ejabberdctl: $EJABBERDCTL_CONFIG_PATH"
echo " --logs dir Directory for logs: $LOGS_DIR"