summaryrefslogtreecommitdiff
path: root/mail/mailman/pkg-deinstall
diff options
context:
space:
mode:
Diffstat (limited to 'mail/mailman/pkg-deinstall')
-rw-r--r--mail/mailman/pkg-deinstall26
1 files changed, 14 insertions, 12 deletions
diff --git a/mail/mailman/pkg-deinstall b/mail/mailman/pkg-deinstall
index 180ac640fa0d..1ab07c748f92 100644
--- a/mail/mailman/pkg-deinstall
+++ b/mail/mailman/pkg-deinstall
@@ -9,9 +9,15 @@ case $2 in
DEINSTALL)
echo "---> Starting deinstall script:"
- echo "---> Zeroing crontab(5) file belonging to user \"%%USER%%\""
- /usr/bin/crontab -u %%USER%% /dev/null
- echo " (The crontab(5) will be deleted completely when user %%USER%% is removed.)"
+ if /usr/bin/crontab -u "%%USER%%" -l | \
+ /usr/bin/diff - %%MAILMANDIR%%/cron/crontab.in >/dev/null 2>&1 ; then
+ echo "---> Zeroing crontab for \"%%USER%%\""
+ /usr/bin/crontab -u "%%USER%%" /dev/null
+ else
+ echo "---> Crontab for \"%%USER%%\" not removed: please deinstall"
+ echo "---> manually if you no-longer wish to use Mailman. eg:"
+ echo "---> /usr/bin/crontab -u "%%USER%%" -r"
+ fi
echo "---> Stopping Mailman's qrunner daemon"
%%PREFIX%%/etc/rc.d/mailman.sh stop >/dev/null 2>&1
@@ -36,19 +42,15 @@ POST-DEINSTALL)
if [ -d %%MAILMANDIR%% ]; then
echo '---> %%MAILMANDIR%% is not empty - this installation may have active lists!'
- echo '---> - The "%%USER%%" user and "%%GROUP%%" group were therefore not deleted.'
- echo '---> - You may delete them with "pw groupdel %%GROUP%%; pw userdel %%USER%%".'
-
echo "---> Restoring \"last_mailman_version\" file"
[ -d %%MAILMANDIR%%/data ] || /bin/mkdir %%MAILMANDIR%%/data
/bin/mv -f /var/tmp/last_mailman_version %%MAILMANDIR%%/data/
-
- else
- echo "---> Removing group \"%%GROUP%%\""
- /usr/sbin/pw groupdel -n %%GROUP%%
- echo "---> Removing user \"%%USER%%\""
- echo 'y' | /usr/sbin/pw userdel -n %%USER%%
fi
+
+ echo '---> - If you are not using Mailman any more, you should manually delete'
+ echo '---> - the "%%USER%%" user and "%%GROUP%%" group.'
+ echo '---> - You may delete them with "pw groupdel %%GROUP%%; pw userdel %%USER%%".'
+
;;
esac