post-maintainer scripts: make sure update-grub is present before executing it.
[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       if ls /boot/grml/*iso >/dev/null 2>&1 ; then
9         if which update-grub >/dev/null 2>&1; then
10           echo "ISOs found inside /boot/grml, invoking update-grub:"
11           update-grub
12         else
13           echo "WARN: ISOs found inside /boot/grml but update-grub not present (huh?)"
14         fi
15       else
16         echo "No *.iso files found inside /boot/grml/. Please create /boot/grml and"
17         echo "place Grml ISO(s) there. Finally invoke update-grub and enjoy your rescue system."
18       fi
19     ;;
20
21     abort-upgrade|abort-remove|abort-deconfigure)
22     ;;
23
24     *)
25         echo "postinst called with unknown argument \`$1'" >&2
26         exit 1
27     ;;
28 esac
29
30 #DEBHELPER#
31
32 exit 0