for isofile in $isopath/wifislax64-*.iso; do
  if [ -e "$isofile" ]; then
    regexp --set=isoname "$isopath/(.*)" "$isofile"
    submenu "$isoname ->" "$isofile" {
      iso_path="$2"
      loopback loop "$iso_path"
      menuentry "Wifislax Live" {
        bootoptions="livemedia=/dev/disk/by-uuid/$rootuuid:$iso_path kbd=us xkb=us locale=us_EN.utf8 tz=localtime"
        linux (loop)/boot/vmlinuz $bootoptions
        initrd (loop)/boot/initrd.xz
      }
      menuentry "Wifislax Live Ram" {
        bootoptions="livemedia=/dev/disk/by-uuid/$rootuuid:$iso_path kbd=us xkb=us locale=us_EN.utf8 tz=localtime toram"
        linux (loop)/boot/vmlinuz $bootoptions
        initrd (loop)/boot/initrd.xz
      }
      menuentry "Wifislax Live Text" {
        bootoptions="livemedia=/dev/disk/by-uuid/$rootuuid:$iso_path kbd=us xkb=us locale=us_EN.utf8 tz=localtime init 3"
        linux (loop)/boot/vmlinuz $bootoptions
        initrd (loop)/boot/initrd.xz
      }
    }
  fi
done
