====== Test for existence ====== ===== Synopsis ===== isset ===== 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 [[:settings|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 ===== * ''[[:cmd:iseq]]'' * ''[[:cmd:set]]'' * ''[[:cmd:show]]'' * ''[[:cmd:goto]]'' * iPXE [[:scripting|scripting]] guide * [[:cmd|List of all iPXE commands]] ===== Notes ===== You should always consider what will happen if the value does not exist. For example: isset ${filename} && chain ${filename} If no ''[[:cfg:filename]]'' is specified then the ''isset'' command will fail and the script will terminate, as described in the [[:scripting#error_handling|scripting guide]]. To avoid this problem, you can use the ''||'' operator: isset ${filename} && chain ${filename} ||