HOST=localhost
# Define ejabberd environment
+ERL=erl
here=`which "$0" 2>/dev/null || echo .`
base="`dirname $here`/.."
ROOTDIR=`(cd "$base"; echo $PWD)`
[ -d $EJABBERD_DB ] || mkdir -p $EJABBERD_DB
[ -f $EJABBERD_CONFIG_PATH ] || cp $ROOTDIR/src/ejabberd.cfg.example $EJABBERD_CONFIG_PATH
-function start
+start()
{
- erl \
+ $ERL \
-noinput -detached \
-sname $NODE@$HOST \
-pa $EJABBERD_EBIN \
-sasl sasl_error_logger \{file,\"$SASL_LOG_PATH\"\}
}
-function debug
+debug()
{
- erl \
+ $ERL \
-sname debug$NODE@$HOST \
-pa $EJABBERD_EBIN \
-mnesia dir "\"$EJABBERD_DB\"" \
-remsh $NODE@$HOST
}
-function ctl
+ctl()
{
- erl \
- -noinput \
- -sname ejabberdctl@$HOST \
+ $ERL \
+ -sname ctl$NODE@$HOST \
-pa $EJABBERD_EBIN \
+ -noinput \
-s ejabberd_ctl -extra $NODE@$HOST $@
}
-function usage
+usage()
{
ctl
exit
debug) debug;;
*) ctl $@;;
esac
-