2024-02-13 13:47:39 +00:00
|
|
|
#!ipxe
|
2024-02-16 14:03:25 +00:00
|
|
|
|
|
|
|
#Init networking
|
|
|
|
dhcp
|
|
|
|
|
|
|
|
#Print useful information for debugging
|
|
|
|
echo next-server is ${next-server}
|
|
|
|
echo filaneme is ${filename}
|
|
|
|
echo MAC address is ${net0/mac}
|
|
|
|
echo IP address is ${ip}
|
|
|
|
|
|
|
|
#Provisioner uses the following pattern: /boot/{mac}
|
|
|
|
set server http://${next-server}/boot/${mac:hexhyp}
|
2024-03-05 08:59:30 +00:00
|
|
|
echo Server is ${server}
|
|
|
|
sleep 5
|
2024-02-16 14:03:25 +00:00
|
|
|
|
|
|
|
# Make an HTTP HEAD request to check if the URL exists
|
|
|
|
http ${server} head || goto link_does_not_exist
|
|
|
|
|
|
|
|
#Make sure the link is valid
|
|
|
|
isset ${http_status} || goto link_does_not_exist
|
|
|
|
iseq ${http_status} 200 && goto link_exists
|
|
|
|
|
|
|
|
:link_does_not_exist
|
2024-03-05 08:59:30 +00:00
|
|
|
sleep 5
|
2024-02-16 14:03:25 +00:00
|
|
|
echo Link ${server} does not exist, booting from next bios/uefi target
|
|
|
|
exit
|
|
|
|
|
|
|
|
:link_exists
|
|
|
|
chain ${server}
|