Halt ejabberd if a command in CTL_ON_ fails during ejabberd startup

See processone/ejabberd-contrib#97
This commit is contained in:
Badlop 2023-06-13 00:39:05 +02:00
parent dcc8149f58
commit ffbcf19156
1 changed files with 6 additions and 0 deletions

View File

@ -283,6 +283,12 @@ post_waiter_loop()
TAIL=${LIST#* ; }
echo ":> ejabberdctl $HEAD"
$0 $HEAD
ctlstatus=$?
if [ $ctlstatus -ne 0 ] ; then
echo ":> FAILURE in command '$HEAD' !!! Stopping ejabberd..."
$0 halt > /dev/null
exit $ctlstatus
fi
[ "$HEAD" = "$TAIL" ] || post_waiter_loop $TAIL
}