mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-06-24 17:58:58 +02:00
change if style (#3361)
This commit is contained in:
parent
0e592aa911
commit
cf74127f78
58 changed files with 297 additions and 594 deletions
|
@ -44,14 +44,12 @@ RESET=$(echo -ne '\e[0m')
|
|||
# is missing. Both failures will return with exit code '1'.
|
||||
function _log
|
||||
{
|
||||
if [[ -z ${1+set} ]]
|
||||
then
|
||||
if [[ -z ${1+set} ]]; then
|
||||
_log 'error' "Call to '_log' is missing a valid log level"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ -z ${2+set} ]]
|
||||
then
|
||||
if [[ -z ${2+set} ]]; then
|
||||
_log 'error' "Call to '_log' is missing a message to log"
|
||||
return 1
|
||||
fi
|
||||
|
@ -100,8 +98,7 @@ function _log
|
|||
|
||||
MESSAGE+="${RESET}] ${2}"
|
||||
|
||||
if [[ ${1} =~ ^(warn|error)$ ]]
|
||||
then
|
||||
if [[ ${1} =~ ^(warn|error)$ ]]; then
|
||||
echo -e "${MESSAGE}" >&2
|
||||
else
|
||||
echo -e "${MESSAGE}"
|
||||
|
@ -120,11 +117,9 @@ function _log_with_date
|
|||
# use the default log level.
|
||||
function _get_log_level_or_default
|
||||
{
|
||||
if [[ -n ${LOG_LEVEL+set} ]]
|
||||
then
|
||||
if [[ -n ${LOG_LEVEL+set} ]]; then
|
||||
echo "${LOG_LEVEL}"
|
||||
elif [[ -e /etc/dms-settings ]] && grep -q -E "^LOG_LEVEL='[a-z]+'" /etc/dms-settings
|
||||
then
|
||||
elif [[ -e /etc/dms-settings ]] && grep -q -E "^LOG_LEVEL='[a-z]+'" /etc/dms-settings; then
|
||||
grep '^LOG_LEVEL=' /etc/dms-settings | cut -d "'" -f 2
|
||||
else
|
||||
echo 'info'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue