Print warning instead of error if group 'dovecot' does not exist.

This commit is contained in:
Christoph 2021-04-19 01:43:02 +02:00
parent 25d0925d06
commit c37da29142

View File

@ -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