f7c39b1d357400ec317c8f22a5812d2f3c0ad33b
[rrq/maintain_lilo.git] / hooks / kernel / postinst.d / zz-runlilo
1 #!/bin/sh
2 #
3 #  zz-runlilo - postinst 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 configure` -eq 1 ]
19         then PAR=configure; fi
20 fi
21
22 # check for configure|upgrade|remove|purge
23 case "$PAR" in
24
25   ever|configure)
26     # Run the boot loader installer
27     if [ -f /sbin/lilo ]; then
28       if [ -f /etc/lilo.conf ]; then
29         lilo  </dev/null  >&2
30       else
31         echo "Warning: Not updating LILO; /etc/lilo.conf not found!"  >&2
32       fi
33     fi
34     ;;
35
36 esac
37
38 # end of file