summaryrefslogtreecommitdiffstats
path: root/autoscripts/postrm-nss-db
diff options
context:
space:
mode:
Diffstat (limited to 'autoscripts/postrm-nss-db')
-rw-r--r--autoscripts/postrm-nss-db6
1 files changed, 6 insertions, 0 deletions
diff --git a/autoscripts/postrm-nss-db b/autoscripts/postrm-nss-db
new file mode 100644
index 0000000..c5a9e70
--- /dev/null
+++ b/autoscripts/postrm-nss-db
@@ -0,0 +1,6 @@
+: "${DPKG_MAINTSCRIPT_PACKAGE_INSTCOUNT:=$(dpkg-query -f '${db:Status-Abbrev}\n' -W "$DPKG_MAINTSCRIPT_PACKAGE" | grep -c '^i')}"
+if { [ "$1" = "remove" ] || [ "$1" = "purge" ] ; } && [ -e "${DPKG_ROOT}/etc/nsswitch.conf" ] && [ "$DPKG_MAINTSCRIPT_PACKAGE_INSTCOUNT" -eq 0 ] ; then
+ if grep -q -E '^#DB#:\s*$' "${DPKG_ROOT}/etc/nsswitch.conf" ; then
+ sed -E -i "${DPKG_ROOT}/etc/nsswitch.conf" -e '/^#DB#:/d'
+ fi
+fi