Nortel Networks 3395 Network Card User Manual


 
Using UNIX Tools With APGEN Script Files
4 -4 893-769-A
Creating a Script File
The APGEN utility provides several command options which allow you to create a script with only certain
commands. For example -menu, -ppp, and -slip create script files with only commands that define
characteristics of those features. Chapter 3 describes each option in detail.
You may want to create a script file with a set of commands that do not have a specific APGEN option to
extract them. To do this, you can use the grep utility with a text string that extracts those commands and
writes them into a file.
To create a script file from the output of a grep command, remove the comment symbol and file name (if
applicable) from the command line, and add #control_script to the beginning of the file. The line
#control_script identifies the file as a script to the terminal server. This example shows how you can use
the grep command to extract the Model 3395 commands that specify secret passwords from the script file,
and then to create another script file from the output:
The following command extracts commands with the text string secret, and writes them to the file
pswd.file:
% grep -e secret opt.file > pswd.file
%
The following commands, listed as comment lines, reside in pswd.file:
% more pswd.file
# DEFINE SERVER PRIVILEGED PASSWORD <secret>
# DEFINE SERVER LOGIN PASSWORD <secret>
# DEFINE SERVER MAINTENANCE PASSWORD <secret>
# DEFINE SERVER PPP PAP REMOTE PASSWORD <secret>
To create a script, edit the file to include the line #control_script, and the passwords:
#control_script
DEFINE SERVER PRIVILEGED PASSWORD "egret"
DEFINE SERVER LOGIN PASSWORD "bluejay"
DEFINE SERVER MAINTENANCE PASSWORD "sparrow"
DEFINE SERVER PPP PAP REMOTE PASSWORD "robin"
You can now execute the SCRIPT command with pswd.file from any terminal server on the network.
Note: If you create a script file that includes passwords, consider making it secure with the appropriate
privileges or placing it in a secure directory. Doing so will prevent unauthorized users from
gaining access to the passwords.