e1bde698f52c82f64cdc8d7a8005a5f59bd15ee8
[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 [ -e /etc/elilo.conf ]; then
14             if [ "$2" ] && dpkg --compare-versions "$2" lt 3.2-1
15             then
16                 db_get elilo/format || true;
17                 if [ x"$RET" = x"true" ]; then
18                     echo "Running elilo..."
19                     /usr/sbin/elilo --format --efiboot
20                 fi
21             else
22                 db_get elilo/runme || true;
23                 if [ x"$RET" = x"true" ]; then
24                     echo "Running elilo..."
25                     /usr/sbin/elilo
26                 fi
27             fi
28         fi
29     ;;
30
31     abort-upgrade|abort-remove|abort-deconfigure)
32         exit 0
33     ;;
34
35     *)
36         echo "postinst called with unknown argument \`$1'" >&2
37         exit 0
38     ;;
39 esac
40
41 #DEBHELPER#
42
43 exit 0