3 running and editing uefi shell scripts, Uefi shell script commands, Invoking scripts – HP Unified Extensible Firmware Interface User Manual
Page 65: Enabling the uefi shell script auto start, Manually invoking a shell script, Editing shell scripts, Sample shell scripts, Uefi shell script commands invoking scripts, Editing shell scripts sample shell scripts, Examples
3 Running and editing UEFI Shell scripts
The following information describes the scripting functions provided by the UEFI Shell.
UEFI Shell script commands
Examples
To export all settings to a file:
fs0:\> Sysconfig –export filename.txt
To import all settings to a file:
fs0:\> Sysconfig –import filename.txt
Invoking scripts
You can invoke UEFI Shell scripts using either of these two methods:
•
“Enabling the UEFI Shell Script Auto Start” (page 65)
•
“Manually invoking a Shell script” (page 65)
Enabling the UEFI Shell Script Auto Start
You can enable or disable automatic execution of the default UEFI Shell script during shell start
up. When enabled, the shell looks for the startup.nsh file in any of the FAT16 or FAT32 file
systems available. HP recommends having only one startup.nsh file on one file system.
To enable the UEFI Shell script auto start:
1.
Access the System Utilities menu. For more information, see
2.
From the System Utilities screen, select System Configuration
→BIOS/Platform Configuration
(RBSU)
→System Options→UEFI Shell Options→UEFI Shell Script Auto-Start and press Enter.
3.
Press F10 to save your selection.
4.
Reboot the server for the change to take effect.
Manually invoking a Shell script
To manually invoke a Shell script:
1.
Navigate to the location of the .nsh Script file.
2.
Double-click the file, or right-click it, and then select Open.
Editing Shell scripts
You can edit script files offline or in the Shell using the edit command. You can also use the type
command to output the script to the screen.
Sample Shell scripts
Examples
The following sample scripts how to capture a configuration (export) and replicate it (import) from
startup.nsh mounted on an iLO virtual media.
Export Example
fs0:\>
@echo -off
UEFI Shell script commands
65