aboutsummaryrefslogtreecommitdiff
path: root/ejabberdctl.template
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2016-03-18 11:08:30 +0100
committerChristophe Romain <christophe.romain@process-one.net>2016-03-18 11:08:30 +0100
commit939bb244e1be08832e21a43afd13b0c96f0790d2 (patch)
tree808c6bf6dccecb42ece4ce86312d851fcbada66c /ejabberdctl.template
parentEscape quoting node name for ejabberdctl ping (diff)
Extend scope of ejabberdctl ping
Diffstat (limited to 'ejabberdctl.template')
-rwxr-xr-xejabberdctl.template9
1 files changed, 8 insertions, 1 deletions
diff --git a/ejabberdctl.template b/ejabberdctl.template
index 3f74da695..dca23fe81 100755
--- a/ejabberdctl.template
+++ b/ejabberdctl.template
@@ -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'\"'\"')])' \