for isofile in $isopath/trisquel*.iso; do
  if [ -e "$isofile" ]; then
    regexp --set=isoname "$isopath/(.*)" "$isofile"
    submenu "$isoname ->" "$isofile" {
      iso_path="$2"
      loopback loop "$iso_path"
      menuentry "Try Trisquel without installing" {
        bootoptions="iso-scan/filename=$iso_path boot=casper splash quiet noprompt --"
        linux (loop)/casper/vmlinuz $bootoptions
        initrd (loop)/casper/initrd
      }
      menuentry "Install Trisquel" {
        bootoptions="iso-scan/filename=$iso_path boot=casper splash quiet noprompt only-ubiquity --"
        linux (loop)/casper/vmlinuz $bootoptions
        initrd (loop)/casper/initrd
      }
    }
  fi
done
