#!ipxe # Minimum viable iPXE script :start prompt --key 0x02 --timeout 2000 \ Press Ctrl-B for the iPXE shell... \ && shell || # Find first working DHCP interface :dhcp dhcp \ && goto dhcp_pass \ || goto dhcp_fail # No DHCP servers or IPv6 autoconf found :dhcp_fail prompt --key 0x02 --timeout 5000 \ DHCP FAIL: Ctrl-B for the iPXE shell; retry in 5 seconds \ && shell || goto start # DHCP found :dhcp_pass isset ${syslog} \ && goto syslog \ || goto autoboot # Log to syslog, but don't fail anyway :syslog echo Sending logs to syslog:${syslog} syslog ${syslog} || # Boot if possible, doesn't return on success :autoboot autoboot || goto fail # Log it and reboot :fail prompt --key 0x02 --timeout 5000 \ DHCP GOOD, AUTOBOOT FAIL: Ctrl-B for the iPXE shell; retry in 5 seconds \ && shell || goto start