Dump & remove user crontab on account deletion

closes #37
This commit is contained in:
Ludovic Poujol 2022-02-17 11:12:55 +01:00
parent ef5bbbeba7
commit f2f115608a

View file

@ -729,6 +729,10 @@ op_del() {
fi
set -x
# Crontab dump needs to be done **before** user deletion
crontab -l -u "$login" &> /home/$login/crontab-$(date '+%Y%m%d-%H%M%S').bak
crontab -r -u "$login"
if [ "$WEB_SERVER" == "apache" ]; then
if id www-"$login" &> /dev/null; then
userdel -f www-"$login"