Allied Telesis SwitchBlade x3100 Series Manual page 930

Release 14.2 - issue 2
Table of Contents

Advertisement

Routine Procedures
the user designs and edits a script file using any plain text editor (NOTE: script files cannot be edited from
the CLI on the system
using the GET FILE command the user puts the file onto the control module card into FLASH
the user can then look at the file and execute it using the SHOW and EXECUTE commands
The following text describes the scripting commands.
The SHOW SCRIPT command displays the contents of a Command Line Interface (CLI) script. A script con-
tains CLI command(s) that are executed using the EXECUTE SCRIPT command.
The EXECUTE SCRIPT command processes all of the commands entered in the specified filename. The
script file contains one or more CLI commands. The first line in the file must contain a comment that identifies
the file as a script. Other text can also exist on the line, but the word 'script' must appear some place in the
line. Comments are identified as a hash(#) as the first character on a line. A CLI command in the script file must
occupy a single line. A command cannot span more than one line. If a command requires user interaction like a
confirmation, the user response text is included on the line after the command.
Here is a summary of the rules for scripts:
The commands in the script file must be syntactically correct.
1.
Each command must be on ONE LINE only. In other words, there is no continuation character.
2.
The first line of the script file must be a comment line with the word "script" in it. This is used to verify that
3.
a file is a valid script file. It is used to prevent the execution of a non-script file (i.e. load file).
If a command returns a failure response, the script will continue to process commands following the error.
4.
It will not exit due to a parsing error OR command failure.
If a command requires a confirmation string, the NEXT LINE must be a 'Y' to provide the confirmation
5.
response. If something other than a Y or N is provided, the script will quit. Alternatively, the user could dis-
able prompting at the beginning of the script.
The user can provide comments and blank lines in script files.
6.
The commands used must be within the realm of the user (i.e. Security Officer, Manager, User).
7.
The contents of a script file are played back as written. Any syntax errors in the file are detected as the script is
run. If an error is encountered, the device under maintenance is left in an unknown condition.
Following is an example script, between the dashed lines.
-----------------------------------------------------------------------------------------------
# This is an example script file. It must have the word SCRIPT in this line
#
# First, list all users already configured in the system
#
SHOW USER
8-58
Software Reference for SwitchBlade x3100 Series Switches (Alarms and Troubleshooting)
Scripting

Advertisement

Table of Contents
loading

Table of Contents