Table of Contents

Test for existence

Synopsis

  isset <value>

Examples

Boot if a filename is specified

  isset ${filename} && chain ${filename} || goto no_filename

Set a default DNS server if none is specified

  isset ${dns} || set dns 192.168.0.1

Retry DHCP indefinitely until a filename is obtained

  #!ipxe
  :retry_dhcp
  dhcp && isset ${filename} || goto retry_dhcp

Description

Test existence of the specified value, which will normally be a configuration setting. Existence is indicated via the command status; the conditional operators && and || can be used to decide what action to take as a result.

Command status

Success The value exists
Failure The value does not exist

See also

Notes

You should always consider what will happen if the value does not exist. For example:

  isset ${filename} && chain ${filename}

If no filename is specified then the isset command will fail and the script will terminate, as described in the scripting guide. To avoid this problem, you can use the || operator:

  isset ${filename} && chain ${filename} ||