671c16463110ab135a794118b97d85d6248def0c
[rrq/maintain_lilo.git] / hooks / kernel / postrm.d / zz-runlilo
1 #!/bin/sh
2 #
3 #  zz-runlilo - postrm script for modern kernel management
4 #
5 #  Copyright 2010 Joachim Wiedorn
6 #  All rights reserved.
7 #
8 #  Licensed under the terms contained in the file 'COPYING'
9 #  in the source directory.
10 #
11
12 set -e
13 PAR=ever
14
15 # check for maintainer param
16 if [ -n "${DEB_MAINT_PARAMS}" ]; then
17         PAR=none
18         if [ `echo "${DEB_MAINT_PARAMS}" | grep -v abort | grep -c remove` -eq 1 ]
19         then PAR=remove; fi
20 fi
21
22 # check for configure|upgrade|remove|purge
23 case "$PAR" in
24
25   ever|remove)
26     # Run the boot loader installer
27     if [ -f /sbin/lilo ]; then
28       if [ -f /etc/lilo.conf ]; then
29         # Do not abort kernel removal in case of error
30         lilo  </dev/null  >&2  || true
31       fi
32     fi
33     ;;
34
35 esac
36
37 # end of file