Prompt user to enter configuration setting


  read [--timeout <timeout>] <setting>


Prompt user to enter boot filename

  read filename

Allow user to configure an IP address for the interface "net0"

  echo -n IP address: && read net0/ip
  echo -n Subnet mask: && read net0/netmask
  echo -n Default gateway: && read net0/gateway

Allow user to edit a kernel command line before booting

  set cmdline selinux=0 console=ttyS0,115200n8 console=tty0
  echo -n Kernel command line: ${}
  read cmdline
  chain http://my.web.server/vmlinuz ${cmdline}


Set value of the specified configuration setting to the value provided by the user, waiting for the specified timeout (in milliseconds). If no timeout is explicitly specified, or if a zero timeout is specified, then iPXE will wait indefinitely.

The value will be interpreted according to the type specified as part of the setting name. For example, to prompt the user to enter a configuration setting for an NTP server address (DHCP option 42):

  read 42:ipv4

If no type is explicitly specified, then the setting's default type will be used.

Command status

Success The configuration setting was applied successfully
Failure The configuration setting was not applied successfully, or no key was pressed within the timeout period

See also


You can use the config command to browse and edit all predefined settings interactively.

You can add a trailing space after a prompt string printed using the echo command by adding an empty variable ${} to the end of the prompt string. For example:

  iPXE> echo -n IP address: ${} && read net0/ip
  IP address:

You can use the present command to present the user with an interactive form to edit your selection of settings.

You can use the login command to prompt the user to enter a user name and password (without displaying the password on-screen).

cmd/read.txt ยท Last modified: 2024/06/21 17:16 by mcb30
Recent changes RSS feed CC Attribution-Share Alike 4.0 International Driven by DokuWiki
All uses of this content must include an attribution to the iPXE project and the URL
References to "iPXE" may not be altered or removed.