Imported Debian patch 3.6-3
[debian/elilo] / debian / postinst
1 #!/bin/sh
2
3 set -e
4
5 if [ -f /usr/share/debconf/confmodule ]; then
6   . /usr/share/debconf/confmodule
7 fi
8
9
10 case "$1" in
11     configure|reconfigure)
12         # On new installs, do nothing - elilo-installer will handle it for d-i
13         if grep -q "^# UNCONFIGURED FSTAB FOR BASE SYSTEM" /etc/fstab ; then
14           exit 0
15         fi
16         if [ "$2" ] && dpkg --compare-versions $2 lt 3.2-1
17         then
18             db_get elilo/format || true;
19             if [ x"$RET" = x"true" ]; then
20                 echo "Running elilo..."
21                 /usr/sbin/elilo --format --efiboot
22             fi
23             exit 0
24         fi
25         db_get elilo/runme || true;
26         if [ x"$RET" = x"true" ]; then
27             echo "Running elilo..."
28             /usr/sbin/elilo
29         fi
30     ;;
31
32     abort-upgrade|abort-remove|abort-deconfigure)
33         exit 0
34     ;;
35
36     *)
37         echo "postinst called with unknown argument \`$1'" >&2
38         exit 0
39     ;;
40 esac
41
42 #DEBHELPER#
43
44 exit 0