# I've assume IPv4 for this script, so if we need IPv6, it may need
# modifications.
# Require only verified images to boot
imgtrust --permanent
# For the "focal" part of the URL string, in case that changes in the future.
set ubuntu-variant focal
goto get_arch
#################
### This section is at the top, so it's easier to modify.
:static_ip_boot_setup
# Open all network interface devices, so we aren't restricted to just the first
ifopen
sleep 1
# Currently we just configure IP info by MAC address. So we iterate over
# MAC addresses and set the variables. To ensure we use the desired
# device, we iterate over all devices and simply find matches by
# MAC address.
set idx:int32 0
set successful f
:loop
isset ${net${idx}/mac} || goto loop_done
######################## SET STATIC IP INFO HERE #############################
# Just copy/paste an entire line to add more
iseq ${net${idx}/mac:string} "00:01:02:A0:B1:C1" && set ip-dev-name eth0 && set ip-addr "192.168.1.5" && set ip-gateway "192.168.1.1" && set ip-netmask "255.255.255.0" && set ip-dns "1.1.1.1" && set successful t && goto loop_done ||
iseq ${net${idx}/mac:string} "03:04:05:D4:E5:F6" && set ip-dev-name eth0 && set ip-addr "192.168.99.2" && set ip-gateway "192.168.99.1" && set ip-netmask "255.255.255.0" && set ip-dns "1.1.1.1" && set successful t && goto loop_done ||
iseq ${net${idx}/mac:string} "40:A8:F0:31:CC:58" && set ip-dev-name eth0 && set ip-addr "93.189.28.82" && set ip-gateway "93.189.28.81" && set ip-netmask "255.255.255.240" && set ip-dns "1.1.1.1" && set successful t && goto loop_done ||
iseq ${net${idx}/mac:string} "40:A8:F0:31:CC:59" && set ip-dev-name eth0 && set ip-addr "93.189.28.82" && set ip-gateway "93.189.28.81" && set ip-netmask "255.255.255.240" && set ip-dns "1.1.1.1" && set successful t && goto loop_done ||