summaryrefslogtreecommitdiffstats
path: root/debian/slapd.postrm
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 11:11:40 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 11:11:40 +0000
commit2886df93860f983d875b7d6acb418faa31491d5a (patch)
treeb596ddcbb70247c1994f3b1d8ba9e793b9788a9d /debian/slapd.postrm
parentAdding upstream version 2.4.57+dfsg. (diff)
downloadopenldap-2886df93860f983d875b7d6acb418faa31491d5a.tar.xz
openldap-2886df93860f983d875b7d6acb418faa31491d5a.zip
Adding debian version 2.4.57+dfsg-3+deb11u1.debian/2.4.57+dfsg-3+deb11u1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--debian/slapd.postrm38
1 files changed, 38 insertions, 0 deletions
diff --git a/debian/slapd.postrm b/debian/slapd.postrm
new file mode 100644
index 0000000..4d7917a
--- /dev/null
+++ b/debian/slapd.postrm
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+set -e
+
+# Load debconf if available (might have been removed before purging
+# slapd)
+
+if [ -e "/usr/share/debconf/confmodule" ]; then
+ . /usr/share/debconf/confmodule
+fi
+
+# Check if the user wants the database removed on purging slapd
+remove_database_on_purge() {
+ db_get slapd/purge_database || RET=false
+ if [ "$RET" = "true" ]; then
+ return 0
+ else
+ return 1
+ fi
+}
+
+if [ "$1" = "purge" ]; then
+ echo -n "Removing slapd configuration... "
+ rm -f /etc/ldap/slapd.conf 2>/dev/null || true
+ rm -rf /etc/ldap/slapd.d 2>/dev/null || true
+ echo "done."
+
+ if remove_database_on_purge; then
+ echo -n "Purging OpenLDAP database... "
+ rm -rf /var/lib/ldap || true
+ echo done
+ fi
+fi
+
+#DEBHELPER#
+
+exit 0
+