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

Merge pull request #1996 from nosnilmot/ejabberdctl-quote-peer

Quote $PEER in ping command to avoid hostnames containing "-" being interpreted as arithmetic
This commit is contained in:
Christophe Romain 2017-09-18 13:09:16 +02:00 committed by GitHub
commit cb076924cc

View File

@ -294,7 +294,7 @@ case $1 in
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
;; ;;
started) started)