blob: 6c007398e8b74d78458edc76e654bb57274bb402 [file] [log] [blame]
#!ipxe
echo Amazon EC2 - iPXE boot via user-data
echo CPU: ${cpuvendor} ${cpumodel}
ifstat ||
set attempt:int8 1
:dhcp_retry
echo DHCP attempt ${attempt}
dhcp --timeout 5000 && goto dhcp_ok ||
ifstat ||
inc attempt
iseq ${attempt} 10 || goto dhcp_retry
:dhcp_fail
echo DHCP failed - rebooting
reboot ||
exit
:dhcp_ok
route ||
chain -ar http://169.254.169.254/latest/user-data ||
ifstat ||
exit