diff options
author | Christophe Romain <christophe.romain@process-one.net> | 2016-03-18 11:08:30 +0100 |
---|---|---|
committer | Christophe Romain <christophe.romain@process-one.net> | 2016-03-18 11:08:30 +0100 |
commit | 939bb244e1be08832e21a43afd13b0c96f0790d2 (patch) | |
tree | 808c6bf6dccecb42ece4ce86312d851fcbada66c /ejabberdctl.template | |
parent | Escape quoting node name for ejabberdctl ping (diff) |
Extend scope of ejabberdctl ping
Diffstat (limited to 'ejabberdctl.template')
-rwxr-xr-x | ejabberdctl.template | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ejabberdctl.template b/ejabberdctl.template index 3f74da69..dca23fe8 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'\"'\"')])' \ |