]> granicus.if.org Git - ejabberd/commitdiff
Extend scope of ejabberdctl ping
authorChristophe Romain <christophe.romain@process-one.net>
Fri, 18 Mar 2016 10:08:30 +0000 (11:08 +0100)
committerChristophe Romain <christophe.romain@process-one.net>
Fri, 18 Mar 2016 10:08:30 +0000 (11:08 +0100)
ejabberdctl.template

index 3f74da695977de7a94b3c166a3a42e15e9916b51..dca23fe81fdd50db39f3cb2635963f37ac3c0dc3 100755 (executable)
@@ -328,8 +328,15 @@ etop()
 ping()
 {
     TTY=`tty | sed -e  's/.*\///g'`
+    if [ "$1" = "${1%.*}" ] ; then
+        PING_NAME="-sname"
+        PING_NODE=$(hostname -s)
+    else
+        PING_NAME="-name"
+        PING_NODE=$(hostname)
+    fi
     $EXEC_CMD "$ERL \
-      $NAME ping-${TTY}-${ERLANG_NODE} \
+      $PING_NAME ping-${TTY}@${PING_NODE} \
       -hidden \
       $KERNEL_OPTS $ERLANG_OPTS \
       -eval 'io:format(\"~p~n\",[net_adm:ping('\"'\"'$1'\"'\"')])' \