Browse Source

Better way to add and delete user

bugfixes
gau1991 10 years ago
parent
commit
1b970de459
  1. 2
      src/modules/stack/install/mail/ee_mod_setup_dovecot.sh
  2. 3
      src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh

2
src/modules/stack/install/mail/ee_mod_setup_dovecot.sh

@ -12,7 +12,7 @@ function ee_mod_setup_dovecot()
ee_lib_echo "Setting up Dovecot, please wait..."
# Adding mail user with GID 5000 and UID 5000
groupadd -g 5000 vmail && useradd -g vmail -u 5000 vmail -d /var/vmail -m \
adduser --uid 5000 --home /var/vmail --disabled-password --gecos '' vmail \
|| ee_lib_error "Unable to setup vmail user/group = " $?
# Configuring dovecot.conf

3
src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh

@ -6,7 +6,8 @@ function ee_mod_remove_dovecot()
$EE_APT_GET $EE_SECOND dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql dovecot-sieve dovecot-managesieved \
|| ee_lib_error "Unable to $EE_SECOND Dovecot, exit status = " $?
userdel -rf vmail || ee_lib_error "Unable to Remove user vmail, exit status = " $?
deluser --remove-home vmail &>> $EE_COMMAND_LOG || ee_lib_error "Unable to Remove user vmail, exit status = " $?
rm -f /etc/init.d/dovecot
rm -rf /var/vmail
}

Loading…
Cancel
Save