Current File : /var/lib/dpkg/info/ec2-hibinit-agent.postrm
#!/bin/sh

set -e

# Automatically added by dh_systemd_start/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_systemd_enable/13.14.1ubuntu5
if [ "$1" = "purge" ]; then
	if [ -x "/usr/bin/deb-systemd-helper" ]; then
		deb-systemd-helper purge 'hibinit-agent.service' >/dev/null || true
	fi
fi
# End automatically added section


case "$1" in
    remove)
        deb-systemd-invoke restart systemd-logind.service || true
        ;;
    purge)
        invoke-rc.d acpid restart > /dev/null || true
        deb-systemd-invoke restart systemd-logind.service || true
        # clean up dynamically added conffile if exists
        rm -f /etc/default/grub.d/99-set-swap.cfg
        update-grub2 || true
        swapoff /swap-hibinit > /dev/null 2>&1 || true
        rm -f /swap-hibinit
        ;;
    *)
        ;;
esac