mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
* tools/ejabberdctl: fix shell function syntax (EJAB-1003).
* tools/ejabberdctl: use a variable for Erlang shell. SVN Revision: 2422
This commit is contained in:
parent
720fd7605d
commit
16be92cc9f
@ -4,6 +4,7 @@ NODE=ejabberd
|
|||||||
HOST=localhost
|
HOST=localhost
|
||||||
|
|
||||||
# Define ejabberd environment
|
# Define ejabberd environment
|
||||||
|
ERL=erl
|
||||||
here=`which "$0" 2>/dev/null || echo .`
|
here=`which "$0" 2>/dev/null || echo .`
|
||||||
base="`dirname $here`/.."
|
base="`dirname $here`/.."
|
||||||
ROOTDIR=`(cd "$base"; echo $PWD)`
|
ROOTDIR=`(cd "$base"; echo $PWD)`
|
||||||
@ -20,9 +21,9 @@ export ERL_MAX_PORTS=32000
|
|||||||
[ -d $EJABBERD_DB ] || mkdir -p $EJABBERD_DB
|
[ -d $EJABBERD_DB ] || mkdir -p $EJABBERD_DB
|
||||||
[ -f $EJABBERD_CONFIG_PATH ] || cp $ROOTDIR/src/ejabberd.cfg.example $EJABBERD_CONFIG_PATH
|
[ -f $EJABBERD_CONFIG_PATH ] || cp $ROOTDIR/src/ejabberd.cfg.example $EJABBERD_CONFIG_PATH
|
||||||
|
|
||||||
function start
|
start()
|
||||||
{
|
{
|
||||||
erl \
|
$ERL \
|
||||||
-noinput -detached \
|
-noinput -detached \
|
||||||
-sname $NODE@$HOST \
|
-sname $NODE@$HOST \
|
||||||
-pa $EJABBERD_EBIN \
|
-pa $EJABBERD_EBIN \
|
||||||
@ -33,9 +34,9 @@ function start
|
|||||||
-sasl sasl_error_logger \{file,\"$SASL_LOG_PATH\"\}
|
-sasl sasl_error_logger \{file,\"$SASL_LOG_PATH\"\}
|
||||||
}
|
}
|
||||||
|
|
||||||
function debug
|
debug()
|
||||||
{
|
{
|
||||||
erl \
|
$ERL \
|
||||||
-sname debug$NODE@$HOST \
|
-sname debug$NODE@$HOST \
|
||||||
-pa $EJABBERD_EBIN \
|
-pa $EJABBERD_EBIN \
|
||||||
-mnesia dir "\"$EJABBERD_DB\"" \
|
-mnesia dir "\"$EJABBERD_DB\"" \
|
||||||
@ -43,9 +44,9 @@ function debug
|
|||||||
-remsh $NODE@$HOST
|
-remsh $NODE@$HOST
|
||||||
}
|
}
|
||||||
|
|
||||||
function ctl
|
ctl()
|
||||||
{
|
{
|
||||||
erl \
|
$ERL \
|
||||||
-noinput \
|
-noinput \
|
||||||
-sname ejabberdctl@$HOST \
|
-sname ejabberdctl@$HOST \
|
||||||
-pa $EJABBERD_EBIN \
|
-pa $EJABBERD_EBIN \
|
||||||
@ -53,7 +54,7 @@ function ctl
|
|||||||
-s ejabberd_ctl -extra $NODE@$HOST $@
|
-s ejabberd_ctl -extra $NODE@$HOST $@
|
||||||
}
|
}
|
||||||
|
|
||||||
function usage
|
usage()
|
||||||
{
|
{
|
||||||
ctl
|
ctl
|
||||||
exit
|
exit
|
||||||
@ -66,4 +67,3 @@ case $1 in
|
|||||||
debug) debug;;
|
debug) debug;;
|
||||||
*) ctl $@;;
|
*) ctl $@;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user