Extend scope of ejabberdctl ping

This commit is contained in:
Christophe Romain 2016-03-18 11:08:30 +01:00
parent f19a54e9a1
commit 939bb244e1
1 changed files with 8 additions and 1 deletions

View File

@ -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'\"'\"')])' \