mirror of
https://github.com/processone/ejabberd
synced 2025-10-05 19:42:11 +02:00
Add ability to ignore failures in execution of container CTL_ON_* commands
This will allow to use register in CTL_ON_CREATE and not abort if used with existing data that have account already registered.
This commit is contained in:
parent
cdaf45f91c
commit
67a6776fba
2 changed files with 18 additions and 8 deletions
15
.github/container/ejabberdctl.template
vendored
15
.github/container/ejabberdctl.template
vendored
|
@ -331,13 +331,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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue