summaryrefslogtreecommitdiff
path: root/src/ejabberdctl.template
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2007-11-26 07:59:35 +0000
committerBadlop <badlop@process-one.net>2007-11-26 07:59:35 +0000
commit399604e55d11c9e22f93511b4b77d58e1ee30396 (patch)
tree9e89b20acf649db4177d095178958407dde4cb5b /src/ejabberdctl.template
parent* src/ejabberd_router.erl: Bugfix (diff)
* src/ejabberdctl.template: Removed bashisms (EJAB-399). Set environment variables instead of passing parameters when calling erl (EJAB-421).
* src/ejabberd_ctl.erl: Improvements in the help messages (EJAB-399). * doc/guide.tex: Improvements in sections ejabberdctl, and Install from Source (EJAB-399). SVN Revision: 978
Diffstat (limited to 'src/ejabberdctl.template')
-rw-r--r--src/ejabberdctl.template28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/ejabberdctl.template b/src/ejabberdctl.template
index 106852fc..cbc41900 100644
--- a/src/ejabberdctl.template
+++ b/src/ejabberdctl.template
@@ -6,7 +6,8 @@ ERLANG_NODE=$NODE@$HOST
# Define ejabberd environment
ROOTDIR=@rootdir@
-EJABBERD_CFG=$ROOTDIR/etc/ejabberd/ejabberd.cfg
+EJABBERD_CONFIG_PATH=$ROOTDIR/etc/ejabberd/ejabberd.cfg
+export EJABBERD_CONFIG_PATH
EJABBERDCTL_CFG=$ROOTDIR/etc/ejabberd/ejabberdctl.cfg
EJABBERD_INETRC=$ROOTDIR/etc/ejabberd/ejabberd.inetrc
EJABBERD_EBIN=$ROOTDIR/var/lib/ejabberd/ebin
@@ -14,6 +15,7 @@ EJABBERD_DB=$ROOTDIR/var/lib/ejabberd/db/$NODE
EJABBERD_MSGS_PATH=$ROOTDIR/var/lib/ejabberd/priv/msgs
EJABBERD_SO_PATH=$ROOTDIR/var/lib/ejabberd/priv/lib
EJABBERD_LOG_PATH=$ROOTDIR/var/log/ejabberd/ejabberd.log
+export EJABBERD_LOG_PATH
SASL_LOG_PATH=$ROOTDIR/var/log/ejabberd/sasl.log
[ -d $EJABBERD_DB ] || mkdir -p $EJABBERD_DB
@@ -35,9 +37,12 @@ else
SNAME=-name
fi
+# Compatibility in ZSH
+#setopt shwordsplit 2>/dev/null
+
ERLANG_OPTS="$POLL $PROCESSES $ERL_MAX_ETS_TABLES"
-function start
+start ()
{
erl \
$SNAME $ERLANG_NODE \
@@ -46,12 +51,10 @@ function start
-pa $EJABBERD_EBIN \
-mnesia dir "\"$EJABBERD_DB\"" \
-s ejabberd \
- -ejabberd config \"$EJABBERD_CFG\" \
- log_path \"$EJABBERD_LOG_PATH\" \
-sasl sasl_error_logger \{file,\"$SASL_LOG_PATH\"\}
}
-function debug
+debug ()
{
echo "--------------------------------------------------------------------"
echo ""
@@ -66,14 +69,15 @@ function debug
echo " control+c, control+c"
echo ""
echo "--------------------------------------------------------------------"
- read -p "Press any key to continue"
+ echo "Press any key to continue"
+ read foo
echo ""
erl \
$SNAME debug \
-remsh $ERLANG_NODE
}
-function live
+live ()
{
echo "--------------------------------------------------------------------"
echo ""
@@ -87,18 +91,18 @@ function live
echo " q(). and press the Enter key"
echo ""
echo "--------------------------------------------------------------------"
- read -p "Press any key to continue"
+ echo "Press any key to continue"
+ read foo
echo ""
erl \
$SNAME $ERLANG_NODE \
$ERLANG_OPTS \
-pa $EJABBERD_EBIN \
-mnesia dir "\"$EJABBERD_DB\"" \
- -ejabberd config \"$EJABBERD_CFG\" \
-s ejabberd
}
-function ctl
+ctl ()
{
erl \
$SNAME ejabberdctl \
@@ -111,13 +115,13 @@ function ctl
esac
}
-function usage
+usage ()
{
ctl
exit
}
-function help_start
+help_start ()
{
echo ""
echo "Commands to start an ejabberd node:"