2 # postinst script for grub-loopback-iso
6 update_grub_wrapper() {
7 # default unless configured otherwise:
8 ISO_LOCATION="/boot/isos"
10 # grml-rescueboot backwards compatibility
11 if [ -d /boot/grml ]; then
12 ISO_LOCATION="${ISO_LOCATION} /boot/grml"
15 if [ -r /etc/default/grub-loopback-isos ] ; then
16 . /etc/default/grub-loopback-isos
19 # grml-rescueboot backwards compatibility
20 if [ -r /etc/default/grml-rescueboot ] ; then
21 . /etc/default/grml-rescueboot
25 for dir in $ISO_LOCATION; do
26 for file in "$dir"/*.iso ; do
27 [ -e "$file" ] || continue
28 iso_list="$iso_list $file"
32 if [ -z "$iso_list" ]; then
33 echo "INFO: No *.iso files found inside ${ISO_LOCATION}."
34 echo "INFO: Please create ${ISO_LOCATION} and place rescue ISO(s) there."
35 echo "INFO: Finally invoke update-grub and enjoy your rescue system."
39 if ! which update-grub >/dev/null 2>&1; then
40 echo "WARN: ISOs found inside ${ISO_LOCATION} but update-grub not present (huh?)"
44 if ! [ -e /boot/grub/grub.cfg ] ; then
45 echo "WARN: ISOs found inside ${ISO_LOCATION} but /boot/grub/grub.cfg does not exist."
46 echo "WARN: Ignoring request to run update-grub to avoid possible boot loader problems."
50 echo "INFO: ISOs found inside ${ISO_LOCATION}, invoking update-grub:"
59 abort-upgrade|abort-remove|abort-deconfigure)
63 echo "postinst called with unknown argument \`$1'" >&2