Skip to content

Commit

Permalink
添加version输出的功能
Browse files Browse the repository at this point in the history
  • Loading branch information
memacs committed Feb 15, 2019
1 parent 909221c commit ccaf746
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ejabberdctl.template
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,12 @@ wait_for_status()
[ $timeout -eq 0 ] && return 1 || return 0
}

# output current version
version()
{
echo "ejabberd version: v1.0.0"
}

# main handler
case "${ARGS[0]}" in
'start') start;;
Expand All @@ -440,6 +446,7 @@ case "${ARGS[0]}" in
'foreground') foreground;;
'ping'*) ping ${ARGS[1]};;
'etop') etop;;
'version') version;;
'started') wait_for_status 0 30 2;; # wait 30x2s before timeout
'stopped') wait_for_status 3 30 2 && stop_epmd;; # wait 30x2s before timeout
*) ctl "${ARGS[@]}";;
Expand Down

0 comments on commit ccaf746

Please sign in to comment.