freebsd-ports/net/openldap24-server/files/pkg-deinstall.in
Xin LI 38231e45ad - Overhaul the way we handle with LDAP data directory, populate
the data directory upon start, not upon install. [1]
 - Update to OpenLDAP 2.4.11.
 - Modify bsd.port.mk to fit with the shared libary version bump [2]
   This has no impact to package building yet as 2.4.x is not the
   default version.

Submitted by:	Mikhail Goriachev <mikhailg webanoide org> [1]
Approved by:	portmgr (marcus) [2]
2008-07-20 03:35:42 +00:00

35 lines
989 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
ECHO_CMD=echo
if [ -f "%%PREFIX%%/etc/openldap/slapd.conf" ]; then
DBDIR=`awk '$1 == "directory" {print $2}' "%%PREFIX%%/etc/openldap/slapd.conf"`
fi
case $2 in
POST-DEINSTALL)
${ECHO_CMD}
${ECHO_CMD} "The OpenLDAP server package has been deleted."
${ECHO_CMD} "If you're *not* upgrading and won't be using"
${ECHO_CMD} "it any longer, you may want to issue the"
${ECHO_CMD} "following commands:"
${ECHO_CMD}
if ([ "${DBDIR}" ] && [ -d "${DBDIR}" ]) || ([ ! "${DBDIR}" ] && [ -d %%DATABASEDIR%% ]); then
${ECHO_CMD} "- to delete the OpenLDAP database permanently (losing all data):"
if [ "${DBDIR}" ] && [ -d "${DBDIR}" ]; then
${ECHO_CMD} " rm -Rf ${DBDIR}"
else
${ECHO_CMD} " rm -Rf %%DATABASEDIR%%"
fi
${ECHO_CMD}
fi
${ECHO_CMD} "- to remove the OpenLDAP user:"
${ECHO_CMD} " pw userdel ldap"
${ECHO_CMD}
${ECHO_CMD} "If you are upgrading, don't forget to restart slapd."
${ECHO_CMD}
;;
esac