Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/processone/ejabberd.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2016-04-21 13:16:21 +0300
committerChristophe Romain <christophe.romain@process-one.net>2016-04-21 13:16:21 +0300
commit8487b51ecdd74f71635a17757a4eea568f4c6bfa (patch)
treee526e5e6385c153a2efc407e83976780155059ef /ejabberdctl.template
parentf7d4aae64db84e0a43fd9f5c446a6f77ebb07885 (diff)
Fix node ping command
Diffstat (limited to 'ejabberdctl.template')
-rwxr-xr-xejabberdctl.template7
1 files changed, 4 insertions, 3 deletions
diff --git a/ejabberdctl.template b/ejabberdctl.template
index f4dcbd05a..224650fe6 100755
--- a/ejabberdctl.template
+++ b/ejabberdctl.template
@@ -327,7 +327,8 @@ etop()
ping()
{
- if [ "$1" = "${1%.*}" ] ; then
+ [ -z "$1" ] && PEER=${ERLANG_NODE} || PEER=$1
+ if [ "$PEER" = "${PEER%.*}" ] ; then
PING_NAME="-sname"
PING_NODE=$(hostname -s)
else
@@ -338,7 +339,7 @@ ping()
$EXEC_CMD "$ERL \
$PING_NAME $NID \
-hidden $KERNEL_OPTS $ERLANG_OPTS \
- -eval 'io:format(\"~p~n\",[net_adm:ping('\"'\"'$1'\"'\"')])' \
+ -eval 'io:format(\"~p~n\",[net_adm:ping('\"'\"'$PEER'\"'\"')])' \
-s erlang halt -output text -noinput"
}
@@ -446,7 +447,7 @@ case "${ARGS[0]}" in
'live') live;;
'iexlive') iexlive;;
'foreground') foreground;;
- 'ping'*) ping ${ARGS# ping};;
+ 'ping'*) ping ${ARGS[1]};;
'etop') etop;;
'started') wait_for_status 0 30 2;; # wait 30x2s before timeout
'stopped') wait_for_status 3 15 2 && stop_epmd;; # wait 15x2s before timeout