summaryrefslogtreecommitdiff
path: root/ejabberdctl.template
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2016-04-25 14:26:04 +0200
committerChristophe Romain <christophe.romain@process-one.net>2016-04-25 14:26:04 +0200
commitbae24464d3ace4e845e5cc6d3ab7f9bf6356a026 (patch)
tree27e5bf34075e809bf06c4b2a291c7d0e7e465a2a /ejabberdctl.template
parentFix use of pubsub node plugin when configured with default_node_config (diff)
Remove useless variable and quote EPMD and SPOOL_DIR
Diffstat (limited to 'ejabberdctl.template')
-rwxr-xr-xejabberdctl.template24
1 files changed, 7 insertions, 17 deletions
diff --git a/ejabberdctl.template b/ejabberdctl.template
index 224650fe..0f0ec29e 100755
--- a/ejabberdctl.template
+++ b/ejabberdctl.template
@@ -10,7 +10,6 @@ FIREWALL_WINDOW=""
ERLANG_NODE=ejabberd@localhost
# define default environment variables
-SCRIPT_DIR=`cd ${0%/*} && pwd`
ERL={{erl}}
IEX={{bindir}}/iex
EPMD={{bindir}}/epmd
@@ -83,18 +82,9 @@ if [ "$EJABBERD_DOC_PATH" = "" ] ; then
fi
if [ "$ERLANG_NODE_ARG" != "" ] ; then
ERLANG_NODE=$ERLANG_NODE_ARG
- NODE=${ERLANG_NODE%@*}
fi
-if [ "{{release}}" != "true" ] ; then
- if [ "$EJABBERDDIR" = "" ] ; then
- EJABBERDDIR={{libdir}}/ejabberd
- fi
- if [ "$EJABBERD_PRIV_PATH" = "" ] ; then
- EJABBERD_PRIV_PATH=$EJABBERDDIR/priv
- fi
- if [ "$EJABBERD_BIN_PATH" = "" ] ; then
- EJABBERD_BIN_PATH=$EJABBERD_PRIV_PATH/bin
- fi
+if [ "{{release}}" != "true" -a "$EJABBERD_BIN_PATH" = "" ] ; then
+ EJABBERD_BIN_PATH={{libdir}}/ejabberd/priv/bin
fi
EJABBERD_LOG_PATH=$LOGS_DIR/ejabberd.log
DATETIME=`date "+%Y%m%d-%H%M%S"`
@@ -141,8 +131,8 @@ fi
[ -z "$date" ] || EJABBERD_OPTS="${EJABBERD_OPTS} log_rotate_date '$date'"
[ -z "$EJABBERD_OPTS" ] || EJABBERD_OPTS="-ejabberd ${EJABBERD_OPTS}"
-[ -d $SPOOL_DIR ] || $EXEC_CMD "mkdir -p $SPOOL_DIR"
-cd $SPOOL_DIR
+[ -d "$SPOOL_DIR" ] || $EXEC_CMD "mkdir -p $SPOOL_DIR"
+cd "$SPOOL_DIR"
# export global variables
export EJABBERD_CONFIG_PATH
@@ -396,13 +386,13 @@ uid()
# stop epmd if there is no other running node
stop_epmd()
{
- $EPMD -names 2>/dev/null | grep -q name || $EPMD -kill >/dev/null
+ "$EPMD" -names 2>/dev/null | grep -q name || "$EPMD" -kill >/dev/null
}
# make sure node not already running and node name unregistered
check_start()
{
- $EPMD -names 2>/dev/null | grep -q " ${ERLANG_NODE%@*} " && {
+ "$EPMD" -names 2>/dev/null | grep -q " ${ERLANG_NODE%@*} " && {
ps ux | grep -v grep | grep -q " $ERLANG_NODE " && {
echo "ERROR: The ejabberd node '$ERLANG_NODE' is already running."
exit 4
@@ -413,7 +403,7 @@ check_start()
echo "Shutdown all other erlang nodes, and call 'epmd -kill'."
exit 5
} || {
- $EPMD -kill >/dev/null
+ "$EPMD" -kill >/dev/null
}
}
}