Prompt user to enter configuration setting

Synopsis

  read <setting>

Examples

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}

Description

Set value of the specified configuration setting to the value provided by the user.

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

See also

Notes

You can use the config command to browse and edit 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: 192.168.0.1

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: 2013/03/07 13:36 by mcb30
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
All uses of this content must include an attribution to the iPXE project and the URL http://ipxe.org
References to "iPXE" may not be altered or removed.