Update lilo.postinst, lilo.postrm, lilo.preinst; remove old hook scripts.
[rrq/maintain_lilo.git] / debian / lilo.postrm
1 #!/bin/sh
2 # postrm script lilo
3 #
4 # see: dh_installdeb(1)
5
6 set -e
7
8 CONF="/etc/lilo.conf"
9 MMAP="/boot/map"
10 BMPS="coffee debian debian-de inside onlyblue tuxlogo debianlilo"
11 LNKS="sarge sid"
12
13 # targets: purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear
14
15 case "$1" in
16         purge)
17                 test -f ${CONF} && mv ${CONF} ${CONF}_backup
18                 test -f ${MMAP} && rm -f ${MMAP}
19         ;;
20     remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
21                 for i in ${BMPS}; do
22                         rm -f /boot/${i}.bmp /boot/${i}.dat;
23                 done
24                 # stay compatible with old lilo 22.8
25                 for i in ${LNKS}; do
26                         test -L /boot/${i}.bmp && rm -f /boot/${i}.bmp;
27                 done
28     ;;
29         *)
30                 echo "postrm called with unknown argument \`$1'" >&2
31                 exit 1
32         ;;
33 esac
34
35 # dh_installdeb will replace this with shell code automatically
36 # generated by other debhelper scripts.
37
38 #DEBHELPER#
39
40 exit 0