From 1ef66fd5c53512b4039ce4d68644074fe43e38be Mon Sep 17 00:00:00 2001 From: Georg Lauterbach <44545919+aendeavor@users.noreply.github.com> Date: Wed, 24 Feb 2021 10:12:20 +0100 Subject: [PATCH] first (may-be) fixes for v9.0.0 startup problems (#1835) * first (may-be) fixes for v9.0.0 startup problems * adjust grep showing an error when it shouldn't --- target/scripts/startup/fixes-stack.sh | 2 ++ target/scripts/startup/setup-stack.sh | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/target/scripts/startup/fixes-stack.sh b/target/scripts/startup/fixes-stack.sh index 33c140b8..8ecd66b7 100644 --- a/target/scripts/startup/fixes-stack.sh +++ b/target/scripts/startup/fixes-stack.sh @@ -25,6 +25,8 @@ function _fix_var_mail_permissions else _notify 'inf' 'Permissions in /var/mail look OK' fi + + return 0 } function _fix_var_amavis_permissions diff --git a/target/scripts/startup/setup-stack.sh b/target/scripts/startup/setup-stack.sh index aebf0435..e900d2ac 100644 --- a/target/scripts/startup/setup-stack.sh +++ b/target/scripts/startup/setup-stack.sh @@ -21,7 +21,7 @@ function _setup_supervisor ;; * ) - _notify 'error' \ + _notify 'err' \ "SUPERVISOR_LOGLEVEL value '${SUPERVISOR_LOGLEVEL}' unknown. Defaulting to 'warn'" sed -i -E \ @@ -382,7 +382,7 @@ function _setup_dovecot_local_user _notify 'inf' "'config/docker-mailserver/postfix-accounts.cf' is not provided. No mail account created." fi - if ! grep '@' /tmp/docker-mailserver/postfix-accounts.cf | grep -q '|' + if ! grep '@' /tmp/docker-mailserver/postfix-accounts.cf 2>/dev/null | grep -q '|' then if [[ ${ENABLE_LDAP} -eq 0 ]] then @@ -749,7 +749,7 @@ function _setup_dkim { _notify 'task' 'Setting up DKIM' - mkdir -p /etc/opendkim + mkdir -p /etc/opendkim && touch /etc/opendkim/SigningTable # check if any keys are available if [[ -e "/tmp/docker-mailserver/opendkim/KeyTable" ]] @@ -763,6 +763,7 @@ function _setup_dkim chmod -R 0700 /etc/opendkim/keys/ else _notify 'warn' 'No DKIM key provided. Check the documentation on how to get your keys.' + [[ ! -f "/etc/opendkim/KeyTable" ]] && touch "/etc/opendkim/KeyTable" fi # setup nameservers paramater from /etc/resolv.conf if not defined