summaryrefslogtreecommitdiffstats
path: root/autoscripts/postrm-nss-db
blob: c5a9e70428d43e54614b76fe13f6a62f8471cf77 (plain)
1
2
3
4
5
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