mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-20 17:27:00 +01:00
Remove useless variable and quote EPMD and SPOOL_DIR
This commit is contained in:
parent
ef90a389c1
commit
bae24464d3
@ -10,7 +10,6 @@ FIREWALL_WINDOW=""
|
|||||||
ERLANG_NODE=ejabberd@localhost
|
ERLANG_NODE=ejabberd@localhost
|
||||||
|
|
||||||
# define default environment variables
|
# define default environment variables
|
||||||
SCRIPT_DIR=`cd ${0%/*} && pwd`
|
|
||||||
ERL={{erl}}
|
ERL={{erl}}
|
||||||
IEX={{bindir}}/iex
|
IEX={{bindir}}/iex
|
||||||
EPMD={{bindir}}/epmd
|
EPMD={{bindir}}/epmd
|
||||||
@ -83,18 +82,9 @@ if [ "$EJABBERD_DOC_PATH" = "" ] ; then
|
|||||||
fi
|
fi
|
||||||
if [ "$ERLANG_NODE_ARG" != "" ] ; then
|
if [ "$ERLANG_NODE_ARG" != "" ] ; then
|
||||||
ERLANG_NODE=$ERLANG_NODE_ARG
|
ERLANG_NODE=$ERLANG_NODE_ARG
|
||||||
NODE=${ERLANG_NODE%@*}
|
|
||||||
fi
|
fi
|
||||||
if [ "{{release}}" != "true" ] ; then
|
if [ "{{release}}" != "true" -a "$EJABBERD_BIN_PATH" = "" ] ; then
|
||||||
if [ "$EJABBERDDIR" = "" ] ; then
|
EJABBERD_BIN_PATH={{libdir}}/ejabberd/priv/bin
|
||||||
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
|
|
||||||
fi
|
fi
|
||||||
EJABBERD_LOG_PATH=$LOGS_DIR/ejabberd.log
|
EJABBERD_LOG_PATH=$LOGS_DIR/ejabberd.log
|
||||||
DATETIME=`date "+%Y%m%d-%H%M%S"`
|
DATETIME=`date "+%Y%m%d-%H%M%S"`
|
||||||
@ -141,8 +131,8 @@ fi
|
|||||||
[ -z "$date" ] || EJABBERD_OPTS="${EJABBERD_OPTS} log_rotate_date '$date'"
|
[ -z "$date" ] || EJABBERD_OPTS="${EJABBERD_OPTS} log_rotate_date '$date'"
|
||||||
[ -z "$EJABBERD_OPTS" ] || EJABBERD_OPTS="-ejabberd ${EJABBERD_OPTS}"
|
[ -z "$EJABBERD_OPTS" ] || EJABBERD_OPTS="-ejabberd ${EJABBERD_OPTS}"
|
||||||
|
|
||||||
[ -d $SPOOL_DIR ] || $EXEC_CMD "mkdir -p $SPOOL_DIR"
|
[ -d "$SPOOL_DIR" ] || $EXEC_CMD "mkdir -p $SPOOL_DIR"
|
||||||
cd $SPOOL_DIR
|
cd "$SPOOL_DIR"
|
||||||
|
|
||||||
# export global variables
|
# export global variables
|
||||||
export EJABBERD_CONFIG_PATH
|
export EJABBERD_CONFIG_PATH
|
||||||
@ -396,13 +386,13 @@ uid()
|
|||||||
# stop epmd if there is no other running node
|
# stop epmd if there is no other running node
|
||||||
stop_epmd()
|
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
|
# make sure node not already running and node name unregistered
|
||||||
check_start()
|
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 " && {
|
ps ux | grep -v grep | grep -q " $ERLANG_NODE " && {
|
||||||
echo "ERROR: The ejabberd node '$ERLANG_NODE' is already running."
|
echo "ERROR: The ejabberd node '$ERLANG_NODE' is already running."
|
||||||
exit 4
|
exit 4
|
||||||
@ -413,7 +403,7 @@ check_start()
|
|||||||
echo "Shutdown all other erlang nodes, and call 'epmd -kill'."
|
echo "Shutdown all other erlang nodes, and call 'epmd -kill'."
|
||||||
exit 5
|
exit 5
|
||||||
} || {
|
} || {
|
||||||
$EPMD -kill >/dev/null
|
"$EPMD" -kill >/dev/null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user