2016-02-05, 01:08
Is it possible, within an iPXE script, to base a conditional statement (or variable value) on whether or not a download protocol is available in the iPXE instance that is running?
IE: Use HTTP if available, if not, use a TFTP url for network booting, something like:
dhcp
isset ${19:integer} || goto noHttp
set url http://...
goto gotProto
:noHttp
set url tftp://....
:gotProto
echo Booting using ${url}
boot ${url}
Since DHCP option 19 is the feature indicator option for ipxe.http, but this doesn't seem to work, perhaps because the option is only set when iPXE is sending the DHCP request, but in this example it's testing the server response (?)
I know I could first try the HTTP and then fall back on the TFTP statement if it fails, but the output of this is messy.
Rob
IE: Use HTTP if available, if not, use a TFTP url for network booting, something like:
dhcp
isset ${19:integer} || goto noHttp
set url http://...
goto gotProto
:noHttp
set url tftp://....
:gotProto
echo Booting using ${url}
boot ${url}
Since DHCP option 19 is the feature indicator option for ipxe.http, but this doesn't seem to work, perhaps because the option is only set when iPXE is sending the DHCP request, but in this example it's testing the server response (?)
I know I could first try the HTTP and then fall back on the TFTP statement if it fails, but the output of this is messy.
Rob