mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-07-28 22:55:35 +02:00
correct application of the new SUPERVISOR_LOGLEVEL variable (#1787)
* correct application of the new SUPERVISOR_LOGLEVEL variable * correcting default log level adjustment * replacing grep &>/dev/null with grep -q
This commit is contained in:
parent
27e68640b6
commit
6c575adae2
2 changed files with 27 additions and 22 deletions
|
@ -356,22 +356,27 @@ function setup
|
|||
|
||||
function _setup_supervisor
|
||||
{
|
||||
case ${SUPERVISOR_LOGLEVEL} in
|
||||
critical | error | warn | info | debug )
|
||||
sed -i -E \
|
||||
"s+loglevel.*+loglevel = ${SUPERVISOR_LOGLEVEL}+g" \
|
||||
/etc/supervisor/supervisord.conf
|
||||
;;
|
||||
* )
|
||||
_notify 'warn' \
|
||||
"SUPERVISOR_LOGLEVEL value '${SUPERVISOR_LOGLEVEL}' unknown. Defaulting to 'warn'"
|
||||
sed -i -E \
|
||||
"s+loglevel.*+loglevel = warn+g" \
|
||||
/etc/supervisor/supervisord.conf
|
||||
;;
|
||||
esac
|
||||
if ! grep -q "loglevel = ${SUPERVISOR_LOGLEVEL}" /etc/supervisor/supervisord.conf
|
||||
then
|
||||
case ${SUPERVISOR_LOGLEVEL} in
|
||||
critical | error | warn | info | debug )
|
||||
sed -i -E \
|
||||
"s+loglevel.*+loglevel = ${SUPERVISOR_LOGLEVEL}+g" \
|
||||
/etc/supervisor/supervisord.conf
|
||||
|
||||
supervisorctl update
|
||||
;;
|
||||
* )
|
||||
_notify 'error' \
|
||||
"SUPERVISOR_LOGLEVEL value '${SUPERVISOR_LOGLEVEL}' unknown. Defaulting to 'warn'"
|
||||
|
||||
sed -i -E \
|
||||
"s+loglevel.*+loglevel = warn+g" \
|
||||
/etc/supervisor/supervisord.conf
|
||||
;;
|
||||
esac
|
||||
|
||||
supervisorctl reload
|
||||
fi
|
||||
}
|
||||
|
||||
function _setup_default_vars
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue