25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

Quote paths to allow spaces (#1789)

This commit is contained in:
Christophe Romain 2017-06-28 11:39:05 +02:00
parent 3c7c71cfa6
commit 0f12804a49

View File

@ -10,9 +10,9 @@ FIREWALL_WINDOW=""
ERLANG_NODE=ejabberd@localhost ERLANG_NODE=ejabberd@localhost
# define default environment variables # define default environment variables
ERL={{erl}} ERL="{{erl}}"
IEX={{bindir}}/iex IEX="{{bindir}}/iex"
EPMD={{epmd}} EPMD="{{epmd}}"
INSTALLUSER={{installuser}} INSTALLUSER={{installuser}}
# check the proper system user is used if defined # check the proper system user is used if defined
@ -110,12 +110,12 @@ exec_cmd()
exec_erl() exec_erl()
{ {
NODE=$1; shift NODE=$1; shift
exec_cmd $ERL ${S:--}name $NODE $ERLANG_OPTS "$@" exec_cmd "$ERL" ${S:--}name $NODE $ERLANG_OPTS "$@"
} }
exec_iex() exec_iex()
{ {
NODE=$1; shift NODE=$1; shift
exec_cmd $IEX ${S:---}name $NODE --erl "$ERLANG_OPTS" "$@" exec_cmd "$IEX" ${S:---}name $NODE --erl "$ERLANG_OPTS" "$@"
} }
# usage # usage
@ -287,7 +287,7 @@ case $1 in
ping) ping)
PEER=${2:-$ERLANG_NODE} PEER=${2:-$ERLANG_NODE}
[ "$PEER" = "${PEER%.*}" ] && PS="-s" [ "$PEER" = "${PEER%.*}" ] && PS="-s"
exec_cmd $ERL ${PS:--}name $(uid ping $(hostname $PS)) $ERLANG_OPTS \ exec_cmd "$ERL" ${PS:--}name $(uid ping $(hostname $PS)) $ERLANG_OPTS \
-noinput -hidden -eval 'io:format("~p~n",[net_adm:ping('"$PEER"')])' \ -noinput -hidden -eval 'io:format("~p~n",[net_adm:ping('"$PEER"')])' \
-s erlang halt -output text -s erlang halt -output text
;; ;;