acrn-hypervisor/debian/acrn-lifemngr.postrm

47 lines
1.4 KiB
Bash

#!/bin/sh
# postrm script for grub-acrn
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
# * <old-postrm> `upgrade' <new-version>
# * <new-postrm> `failed-upgrade' <old-version>
# * <new-postrm> `abort-install'
# * <new-postrm> `abort-install' <old-version>
# * <new-postrm> `abort-upgrade' <old-version>
# * <disappearer's-postrm> `disappear' <overwriter>
# <overwriter-version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
remove|purge)
# remove any preinstalled & unchanged configfile
if cmp -s "/etc/life_mngr/life_mngr.conf" "/usr/share/acrn-lifemngr/life_mngr.conf.service_vm" || \
cmp -s "/etc/life_mngr/life_mngr.conf" "/usr/share/acrn-lifemngr/life_mngr.conf.user_vm" ; then
rm -f /etc/life_mngr/life_mngr.conf
# also remove an empty config directory
[ "$(ls -A /etc/life_mngr)" ] && rm -rf /etc/life_mngr
fi
;;
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0