diff options
Diffstat (limited to 'security/courier-authlib/files/pkg-deinstall.in')
-rw-r--r-- | security/courier-authlib/files/pkg-deinstall.in | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/security/courier-authlib/files/pkg-deinstall.in b/security/courier-authlib/files/pkg-deinstall.in new file mode 100644 index 000000000000..db7da5cfbd91 --- /dev/null +++ b/security/courier-authlib/files/pkg-deinstall.in @@ -0,0 +1,28 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +PKG_PREFIX=${PKG_PREFIX:=/usr/local} +LOCALSTATEDIR=${LOCALSTATEDIR:=/var/spool/courier} + +USER=%%MAILOWN%% +GROUP=%%MAILGRP%% + +if [ ":$2" = ":POST-DEINSTALL" ]; then + if [ -z "${PACKAGE_BUILDING}" ]; then + echo "" + echo "Warning: Removing user courier will also delete any" + echo " undelivered mail in the mail queue directories!!!" + echo " Do *not* do it if you're upgrading and would like" + echo " courier to continue trying to deliver this mail." + echo "" + else + AFFIRM='-y' + fi + [ -d "$LOCALSTATEDIR" ] && /usr/sbin/chown -Rh ${USER}:${GROUP} "$LOCALSTATEDIR" + /usr/sbin/rmuser ${AFFIRM} ${USER} 2> /dev/null + [ -d "$LOCALSTATEDIR" ] && /usr/sbin/chown root:wheel "$LOCALSTATEDIR" +fi + +exit 0 |