aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérôme Sautret <jerome.sautret@process-one.net>2009-08-06 09:55:35 +0000
committerJérôme Sautret <jerome.sautret@process-one.net>2009-08-06 09:55:35 +0000
commit410cdc3c5c84a12aa68936f95fcb7c0b174e5e1f (patch)
tree16d050101351c700e2f1b319b6b13a9d9caa6106
parenttreap.erl backport (diff)
Backport r2422 and r2423 from trunk:2.0.x
* tools/ejabberdctl: fix shell function syntax (EJAB-1003). * tools/ejabberdctl: use a variable for Erlang shell. * tools/ejabberdctl: cosmetic change. SVN Revision: 2424
-rwxr-xr-xtools/ejabberdctl20
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/ejabberdctl b/tools/ejabberdctl
index c821e8081..ebdeddc40 100755
--- a/tools/ejabberdctl
+++ b/tools/ejabberdctl
@@ -4,6 +4,7 @@ NODE=ejabberd
HOST=localhost
# Define ejabberd environment
+ERL=erl
here=`which "$0" 2>/dev/null || echo .`
base="`dirname $here`/.."
ROOTDIR=`(cd "$base"; echo $PWD)`
@@ -20,9 +21,9 @@ export ERL_MAX_PORTS=32000
[ -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 \
@@ -33,25 +34,25 @@ function start
-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
@@ -64,4 +65,3 @@ case $1 in
debug) debug;;
*) ctl $@;;
esac
-