File: //var/lib/dpkg/info/ntpsec.postrm
#!/bin/sh
set -e
# These are included manually, as the postinst needs custom ordering.
dpkg-maintscript-helper mv_conffile /etc/default/ntp /etc/default/ntpsec 1.1.0\+dfsg1-2\~ ntpsec -- "$@"
dpkg-maintscript-helper mv_conffile /etc/init.d/ntp /etc/init.d/ntpsec 1.1.0\+dfsg1-2\~ ntpsec -- "$@"
dpkg-maintscript-helper mv_conffile /etc/ntp.conf /etc/ntpsec/ntp.conf 1.1.0\+dfsg1-2\~ ntpsec -- "$@"
installinit_error() {
exit $?
}
# Automatically added by dh_installinit/13.11.4
if [ "$1" = "remove" ] && [ -x "/etc/init.d/ntpsec" ] ; then
chmod -x "/etc/init.d/ntpsec" >/dev/null || true
fi
if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = "purge" ] ; then
update-rc.d ntpsec remove >/dev/null
fi
# End automatically added section
# Automatically added by dh_installsystemd/13.11.4
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.11.4
if [ "$1" = "purge" ]; then
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper purge 'ntpsec-rotate-stats.timer' 'ntpsec-systemd-netif.path' 'ntpsec.service' >/dev/null || true
fi
fi
# End automatically added section
# Automatically added by dh_apparmor/3.0.8-3
if [ "$1" = "purge" ] && ! [ -e "/etc/apparmor.d/usr.sbin.ntpd" ] ; then
rm -f "/etc/apparmor.d/disable/usr.sbin.ntpd" || true
rm -f "/etc/apparmor.d/force-complain/usr.sbin.ntpd" || true
rm -f "/etc/apparmor.d/local/usr.sbin.ntpd" || true
rm -f /var/cache/apparmor/*/"usr.sbin.ntpd" || 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/systemd/system/ntpsec.timer
rm -rf /var/lib/ntpsec/ntp.drift /var/log/ntpsec
rmdir /var/lib/ntpsec 2> /dev/null || true
if ! LANG=C dpkg -s ntpsec-ntpviz 2> /dev/null | \
grep -qE "^Status: (hold|install)"; then
deluser --system --quiet ntpsec || true
fi
fi