freebsd-ports/security/courier-authlib/files/pkg-deinstall.in
Oliver Lehmann c149369e83 Just remove the user if BATCH is set in env, don't ask for users feedback.
PR:		84349
Submitted by:	Matthias Andree <matthias.andree@gmx.de>
2005-07-30 21:55:23 +00:00

28 lines
808 B
Bash

#!/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}" -a -z "${BATCH}" ]; 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