User guide
Controlling and Provisioning Network Devices Provisioning a Device
140
AlliedView NMS Administration Guide
5.3.3.3 Edit Files
The Edit Files button brings up the unloaded multi-paged editor, from which command scripts can be written, saved and
edited. The Edit window functions are described in 5.3.15.
For command script files, the Editor displays the contents of a Command Line Interface (CLI) script. The script file contains
one or more CLI commands. 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,
such as a confirmation, the user response text is included on the line after the command.
Following is a summary of the rules for creating and editing scripts:
• The commands in the script file must be syntactically correct.
• Each command must be on ONE LINE only. In other words, there is no continuation character.
• For iMAP devices, the first line of the script file must be a comment line with the word “script” in it. This is used to verify
that 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. 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 response. If
something other than a Y or N is provided, the script will quit.
• The user can provide comments (prefaced with a #) and blank lines in script files.
• The commands used must be within the realm of the user (i.e. Security Officer, Manager, User).
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
5.3.3.4 Delete Command Scripts Option
The Delete Files button brings up the unloaded multi-paged editor, from which command scripts can be written, saved and
edited. The Edit window functions are described in 5.3.16.
5.3.3.5 Compare Files
The Compare Files button brings up the File Comparison window, and is explained in 5.9.3.
5.3.3.6 Creating a Login Banner on a iMAP Device
Command script management can be used with iMAP Devices to create a login banner. Here are the steps:
1. Use Edit Files to create the login banner or message-of-the-day file. This is just a text file, for example:
********************************************
** **
** H E L L O W O R L D **
** **
********************************************
2. Save the file as motd.txt.
3. Use Download to download motd.txt to selected iMAP devices.
4. Use Edit Files to create a Allied Telesis script file that assigns the login banner file, for example:
# script
set loginbanner file=motd.txt
5. Use Download/Execute to download and execute the script on the selected iMAP devices.