From c37da2914253df1107a6bcb239fd699ff0cdcc50 Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 19 Apr 2021 01:43:02 +0200 Subject: [PATCH] Print warning instead of error if group 'dovecot' does not exist. --- install_postfixadmin.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/install_postfixadmin.sh b/install_postfixadmin.sh index 69285fb..b12fb23 100755 --- a/install_postfixadmin.sh +++ b/install_postfixadmin.sh @@ -2319,12 +2319,17 @@ echononl "\tAdd Apache User (${HTTP_USER}) to group 'dovecot'.." if getent group dovecot 2> /dev/null | grep -q "\b${HTTP_USER}\b" > /dev/null 2>&1 ; then echo_skipped else - usermod -a -G dovecot $HTTP_USER > $log_file 2>&1 - if [[ $? -eq 0 ]] ; then - echo_ok + if ! $(grep dovecot /etc/group > /dev/null) ; then + echo_skipped + warn "Group 'dovecot' not present.!" else - echo_failed - error "$(cat $log_file)" + usermod -a -G dovecot $HTTP_USER > $log_file 2>&1 + if [[ $? -eq 0 ]] ; then + echo_ok + else + echo_failed + error "$(cat $log_file)" + fi fi fi