Skip to content

Commit

Permalink
Recognize "!" flag in CTL_ON_{CREATE|START} to ignore failing commands
Browse files Browse the repository at this point in the history
  • Loading branch information
prefiks committed Feb 13, 2024
1 parent ee1d178 commit c0acc7a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions ecs/bin/ejabberdctl
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,18 @@ post_waiter_loop()
LIST=$@
HEAD=${LIST%% ; *}
TAIL=${LIST#* ; }
echo ":> ejabberdctl $HEAD"
$0 $HEAD
HEAD2=${HEAD#\! *}
echo ":> ejabberdctl $HEAD2"
$0 $HEAD2
ctlstatus=$?
if [ $ctlstatus -ne 0 ] ; then
echo ":> FAILURE in command '$HEAD' !!! Stopping ejabberd..."
$0 halt > /dev/null
exit $ctlstatus
if [ "$HEAD" != "$HEAD2" ] ; then
echo ":> FAILURE in command '$HEAD2' !!! Ignoring result"
else
echo ":> FAILURE in command '$HEAD' !!! Stopping ejabberd..."
$0 halt > /dev/null
exit $ctlstatus
fi
fi
[ "$HEAD" = "$TAIL" ] || post_waiter_loop $TAIL
}
Expand Down

0 comments on commit c0acc7a

Please sign in to comment.