Release new version 0.3.3
[grml-rescueboot.git] / debian / postinst
1 #!/bin/sh
2 # postinst script for grml-rescueboot
3
4 set -e
5
6 case "$1" in
7     configure)
8       # default, unless configured otherwise:
9       ISO_LOCATION=/boot/grml
10
11       if [ -r /etc/default/grml-rescueboot ] ; then
12         . /etc/default/grml-rescueboot
13       fi
14
15       if ! ls "${ISO_LOCATION}"/*iso >/dev/null 2>&1 ; then
16         echo "INFO: No *.iso files found inside ${ISO_LOCATION}."
17         echo "INFO: Please create ${ISO_LOCATION} and place rescue ISO(s) there."
18         echo "INFO: Finally invoke update-grub and enjoy your rescue system."
19       else
20         if ! which update-grub >/dev/null 2>&1; then
21           echo "WARN: ISOs found inside ${ISO_LOCATION} but update-grub not present (huh?)"
22         else
23           echo "INFO: ISOs found inside ${ISO_LOCATION}, invoking update-grub:"
24           update-grub
25         fi
26       fi
27     ;;
28
29     abort-upgrade|abort-remove|abort-deconfigure)
30     ;;
31
32     *)
33         echo "postinst called with unknown argument \`$1'" >&2
34         exit 1
35     ;;
36 esac
37
38 #DEBHELPER#
39
40 exit 0