HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ns3133907 6.8.0-84-generic #84-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 5 22:36:38 UTC 2025 x86_64
User: cssnetorguk (1024)
PHP: 8.2.28
Disabled: NONE
Upload Files
File: //var/lib/dpkg/info/bind9.postrm
#!/bin/sh

set -e

# Automatically added by dh_installinit/13.14.1ubuntu5
if [ "$1" = "remove" ] && [ -x "/etc/init.d/named" ] ; then
	chmod -x "/etc/init.d/named" >/dev/null || true
fi
if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = "purge" ] ; then
	update-rc.d named remove >/dev/null
fi
# End automatically added section
# Automatically added by dh_installdeb/13.14.1ubuntu5
dpkg-maintscript-helper mv_conffile /etc/default/bind /etc/default/named 1:9.13.6\~ -- "$@"
dpkg-maintscript-helper mv_conffile /etc/default/bind9 /etc/default/named 1:9.12.0\~ -- "$@"
dpkg-maintscript-helper mv_conffile /etc/init.d/bind /etc/init.d/named 1:9.13.6\~ -- "$@"
dpkg-maintscript-helper mv_conffile /etc/init.d/bind9 /etc/init.d/named 1:9.12.0\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/apparmor.d/local/usr.sbin.named 1:9.11.4\+dfsg-1\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/bind/db.root 1:9.11.4\+dfsg-3\~ -- "$@"
# End automatically added section
# Automatically added by dh_installsystemd/13.14.1ubuntu5
if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
	systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installsystemd/13.14.1ubuntu5
if [ "$1" = "purge" ]; then
	if [ -x "/usr/bin/deb-systemd-helper" ]; then
		deb-systemd-helper purge 'named.service' >/dev/null || true
	fi
fi
# End automatically added section
# Automatically added by dh_installsystemd/13.14.1ubuntu5
if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
	systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installsystemd/13.14.1ubuntu5
if [ "$1" = "purge" ]; then
	if [ -x "/usr/bin/deb-systemd-helper" ]; then
		deb-systemd-helper purge 'named-resolvconf.service' >/dev/null || true
	fi
fi
# End automatically added section
# Automatically added by dh_apparmor/4.0.0-beta3-0ubuntu3
if [ "$1" = "purge" ] && ! [ -e "/etc/apparmor.d/usr.sbin.named" ] ; then
    rm -f "/etc/apparmor.d/disable/usr.sbin.named" || true
    rm -f "/etc/apparmor.d/force-complain/usr.sbin.named" || true
    rm -f "/etc/apparmor.d/local/usr.sbin.named" || true
    rm -f /var/cache/apparmor/*/"usr.sbin.named" || true
    rmdir /etc/apparmor.d/disable 2>/dev/null || true
    rmdir /etc/apparmor.d/local   2>/dev/null || true
    rmdir /etc/apparmor.d         2>/dev/null || true
fi
# End automatically added section


if [ "$1" = "purge" ]; then
	rm -f /etc/bind/rndc.key
	rmdir /etc/bind >/dev/null 2>&1 || true
	rm -f /etc/apparmor.d/force-complain/usr.sbin.named >/dev/null 2>&1 || true
	rmdir /var/lib/bind || true
	# delete bind daemon user, if it exists
	if getent passwd bind > /dev/null ; then
		deluser  --quiet bind > /dev/null || true
	fi
fi

exit 0