Recognize "!" flag in CTL_ON_{CREATE|START} to ignore failing commands

pull/112/head
Paweł Chmielowski 3 months ago
parent ee1d178f33
commit c0acc7aeb8

@ -278,13 +278,18 @@ post_waiter_loop()
LIST=$@ LIST=$@
HEAD=${LIST%% ; *} HEAD=${LIST%% ; *}
TAIL=${LIST#* ; } TAIL=${LIST#* ; }
echo ":> ejabberdctl $HEAD" HEAD2=${HEAD#\! *}
$0 $HEAD echo ":> ejabberdctl $HEAD2"
$0 $HEAD2
ctlstatus=$? ctlstatus=$?
if [ $ctlstatus -ne 0 ] ; then if [ $ctlstatus -ne 0 ] ; then
echo ":> FAILURE in command '$HEAD' !!! Stopping ejabberd..." if [ "$HEAD" != "$HEAD2" ] ; then
$0 halt > /dev/null echo ":> FAILURE in command '$HEAD2' !!! Ignoring result"
exit $ctlstatus else
echo ":> FAILURE in command '$HEAD' !!! Stopping ejabberd..."
$0 halt > /dev/null
exit $ctlstatus
fi
fi fi
[ "$HEAD" = "$TAIL" ] || post_waiter_loop $TAIL [ "$HEAD" = "$TAIL" ] || post_waiter_loop $TAIL
} }

Loading…
Cancel
Save