mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
adjusting _seup_supervisor to not restart when wrong log-level given
This commit is contained in:
parent
0fa5c1ef9d
commit
0d9fb096b7
|
@ -14,25 +14,27 @@ function _setup_supervisor
|
|||
if ! grep -q "loglevel = ${SUPERVISOR_LOGLEVEL}" /etc/supervisor/supervisord.conf
|
||||
then
|
||||
case "${SUPERVISOR_LOGLEVEL}" in
|
||||
'critical' | 'error' | 'warn' | 'info' | 'debug' )
|
||||
'critical' | 'error' | 'info' | 'debug' )
|
||||
sed -i -E \
|
||||
"s|loglevel.*|loglevel = ${SUPERVISOR_LOGLEVEL}|g" \
|
||||
"s|(loglevel).*|\1 = ${SUPERVISOR_LOGLEVEL}|g" \
|
||||
/etc/supervisor/supervisord.conf
|
||||
|
||||
supervisorctl reload
|
||||
;;
|
||||
|
||||
'warn' )
|
||||
return 0
|
||||
;;
|
||||
|
||||
* )
|
||||
_notify 'err' \
|
||||
"SUPERVISOR_LOGLEVEL value '${SUPERVISOR_LOGLEVEL}' unknown. Defaulting to 'warn'"
|
||||
|
||||
sed -i -E \
|
||||
's|loglevel.*|loglevel = warn|g' \
|
||||
/etc/supervisor/supervisord.conf
|
||||
"SUPERVISOR_LOGLEVEL '${SUPERVISOR_LOGLEVEL}' unknown. Using default 'warn'"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
supervisorctl reload
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
function _setup_default_vars
|
||||
|
|
Loading…
Reference in a new issue