aboutsummaryrefslogtreecommitdiffstats
path: root/mail/dovecot-devel/pkg-deinstall
diff options
context:
space:
mode:
authorsergei <sergei@FreeBSD.org>2003-12-09 00:08:14 +0800
committersergei <sergei@FreeBSD.org>2003-12-09 00:08:14 +0800
commit1af9d39a030a61519820657e0f693e8d4f79f6e1 (patch)
tree680949508b272a92b7318d565af61f525489de7f /mail/dovecot-devel/pkg-deinstall
parent4ce5391e2b1dea9717ec6106929dbda83a04fadb (diff)
downloadfreebsd-ports-gnome-1af9d39a030a61519820657e0f693e8d4f79f6e1.tar.gz
freebsd-ports-gnome-1af9d39a030a61519820657e0f693e8d4f79f6e1.tar.zst
freebsd-ports-gnome-1af9d39a030a61519820657e0f693e8d4f79f6e1.zip
- Update to 0.99.10.4
- Improve pkg-install script (create /var/dovecot tree) - Add pkg-deinstall to cleanup dovecot directories and remove created uids at de-install; ask to stop dovecot if it's still running - Make pkg-message obey PREFIX/DOCSDIR - Make use of USE_OPENLDAP, rename WITH_LDAP2 to more standard WITH_LDAP - Remove 'Feature Autodetection'. If you want the port built with extra dependencies, tell it: avoid bloat - Update the rc.d script to work with relative addressing (e.g. './dovecot.sh start' works.) - Assign maintainership to the submitter PR: 59762 Submitted by: Robin Breathe <robin@isometry.net>
Diffstat (limited to 'mail/dovecot-devel/pkg-deinstall')
-rw-r--r--mail/dovecot-devel/pkg-deinstall55
1 files changed, 55 insertions, 0 deletions
diff --git a/mail/dovecot-devel/pkg-deinstall b/mail/dovecot-devel/pkg-deinstall
new file mode 100644
index 000000000000..4f9c3a063539
--- /dev/null
+++ b/mail/dovecot-devel/pkg-deinstall
@@ -0,0 +1,55 @@
+#! /bin/sh
+
+ask() {
+ local question default answer
+
+ question=$1
+ default=$2
+ if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
+ read -p "${question} [${default}]? " answer
+ fi
+ echo ${answer:-${default}}
+}
+
+yesno() {
+ local question default answer
+
+ question=$1
+ default=$2
+ while :; do
+ answer=$(ask "${question}" "${default}")
+ case "${answer}" in
+ [Yy]*) return 0;;
+ [Nn]*) return 1;;
+ esac
+ echo "Please answer yes or no."
+ done
+}
+
+delete_account() {
+ local u
+
+ u=$1
+ if yesno "Do you want me to remove user \"${u}\"" n; then
+ pw userdel -n ${u}
+ echo "Done."
+ fi
+}
+
+case $2 in
+
+DEINSTALL)
+ if ps -axc | grep -qw dovecot; then
+ if yesno "Dovecot is still running. Shall I stop it?" y; then
+ killall dovecot
+ sleep 2
+ else
+ echo "OK ... I hope you know what you are doing."
+ fi
+ fi
+
+ delete_account dovecot
+ delete_account dovecot-auth
+ ;;
+
+esac