[ipxe-devel] iPXE scripting enhancements

Michael Brown mbrown at fensystems.co.uk
Thu Dec 9 00:30:53 UTC 2010

On Wednesday 08 Dec 2010 22:01:16 Duane Voth wrote:
> On Sun, Nov 21, 2010 at 8:04 PM, Michael Brown <mcb30 at ipxe.org> wrote:
> > iPXE commands can now contain short-circuit logical operators such as
> > "&&" and
> > "||".  For example,
> >
> >  dhcp net0 || set net0/ip   # Use static IP if DHCP fails
> >
> > <snip>
> Excellent, quite useful!  These will also work for imgfetch etc. no?

Yes; they will work for all commands.  As an illustration of what can be done, 
here's the embedded script I've been using for testing for the past few days:


  echo Creating VLAN 2
  vcreate --tag 2 net0
  set NETDEV net0-2

  echo Acquiring IP address and boot filename on ${NETDEV}
  dhcp ${NETDEV} && isset ${filename} || goto dhcp

  echo Downloading Tivoli reference image
  set TIVOLIBIN http://dolphin.home/images/tivoli.bin
  imgfetch ${TIVOLIBIN} || goto imgfetch

  echo Booting Tivoli (${filename})
  chain ${filename} || goto boot


More information about the ipxe-devel mailing list