Supporting comments and blank lines in cli scripts – HP Virtual Connect 1.10Gb-F Ethernet Module for c-Class BladeSystem User Manual

Page 8

Advertising
background image

Introduction 8

add profile Profile1
add network Network1
add uplinkset UplinkSet1
Example 2: Sample commands using command batching
add profile Profile1;add network Network1;add uplinkset UplinkSet1

Supporting comments and blank lines in CLI scripts

Scripts are useful for batching many CLI commands. Administrators can create a single CLI script to

configure an entire VC domain from scratch and use it on multiple enclosures.
The updated version of the CLI supports command scripts that contain blank lines and comments. In

previous firmware versions, all commands that were provided as input to the CLI through scripts could

only be valid commands. Supporting comments and blank lines enables users to maintain descriptive

comments and notes in the configuration script more easily.
When using a Linux SSH client, simply redirect the script into SSH. If the SSH keys are not configured on

the client and in the firmware, a password prompt appears. To allow script automation and better

security, SSH public/private key-pairs can be generated and uploaded to the public key to the VC

firmware.
>ssh [email protected] < myscript.txt
When using a Windows-based SSH client, pass the file to the client using the -m option. If the SSH keys

are not configured on the client and in the firmware, a password prompt appears. To allow script

automation and better security, SSH public/private key-pairs can be generated and uploaded to the

public key to the VC firmware.
>plink [email protected] -m myscript.txt
The following sample script illustrates a CLI script that contains this type of formatting. Note that all

comment lines must begin with "#".
#------------------------------------------------------------------------
# This is my sample Virtual Connect Domain Configuration Script
# Revision 1.0.1.2
# February 15, 2008
#------------------------------------------------------------------------

# Add Some Users
add user SomeNetworkUser password=pass1 privileges=network
add user SomeStorageUser password=pass2 privileges=storage
add user SomeDomainUser password=pass6 privileges=domain
add user SomeAdminUser password=pass3 privileges=*
add user DomainNetworkUser password=764dhh privileges=domain,network

# Add Some Profiles with Default VC-Enet and VC-FC Connections
add profile MyProfile

Advertising