for isofile in $isopath/openSUSE-*-NET-*.iso $isopath/openSUSE-*-DVD-*.iso; do
  if [ -e "$isofile" ]; then
    regexp --set=isoname "$isopath/(.*)" "$isofile"
    submenu "$isoname ->" "$isofile" {
      iso_path="$2"
      loopback loop "$iso_path"
      menuentry "Installation" {
        bootoptions="install=hd:$iso_path splash=silent showopts"
        linux (loop)/boot/*/loader/linux $bootoptions
        initrd (loop)/boot/*/loader/initrd
      }
      menuentry "Upgrade" {
        bootoptions="install=hd:$iso_path splash=silent upgrade=1 showopts"
        linux (loop)/boot/*/loader/linux $bootoptions
        initrd (loop)/boot/*/loader/initrd
      }
      menuentry "Rescue System" {
        bootoptions="install=hd:$iso_path splash=silent rescue=1 showopts"
        linux (loop)/boot/*/loader/linux $bootoptions
        initrd (loop)/boot/*/loader/initrd
      }
      menuentry "Check Installation Media" {
        bootoptions="install=hd:$iso_path splash=silent mediacheck=1 showopts"
        linux (loop)/boot/*/loader/linux $bootoptions
        initrd (loop)/boot/*/loader/initrd
      }
    }
  fi
done
