for isofile in $isopath/antergos-*.iso; do
  if [ -e "$isofile" ]; then
    regexp --set=isoname "$isopath/(.*)" "$isofile"
    submenu "$isoname ->" "$isofile" {
      iso_path="$2"
      loopback loop "$iso_path"
      probe --label --set=cd_label (loop)
      menuentry "Start Antergos Live" {
        bootoptions="img_dev=$imgdevpath img_loop=$iso_path archisobasedir=arch archisolabel=$cd_label earlymodules=loop modules-load=loop rd.modules-load=loop udev.log-priority=crit rd.udev.log-priority=crit quiet splash"
        linux (loop)/arch/boot/vmlinuz $bootoptions
        initrd (loop)/arch/boot/archiso.img
      }
      menuentry "Non-Graphical Boot" {
        bootoptions="img_dev=$imgdevpath img_loop=$iso_path archisobasedir=arch archisolabel=$cd_label earlymodules=loop modules-load=loop rd.modules-load=loop systemd.unit=multi-user.target"
        linux (loop)/arch/boot/vmlinuz $bootoptions
        initrd (loop)/arch/boot/archiso.img
      }
    }
  fi
done
