The CLI
script
command is the tool used for script management and execution. The complete
syntax of the command is described in the
CLI Reference Guide
and specific examples of usage are
detailed in the following sections. See also
.
Note: Uploaded scripts are lost after a restart
Uploaded CLI script files are not held in permanent memory and will disappear after
system restarts.
Only Four Commands are Allowed in CLI Scripts
The commands allowed in a script file are limited to four and these are:
•
add
•
set
•
delete
•
cc
If any other command appears in a script file it is ignored during execution and a warning
message is output. For example, the
ping
command will be ignored.
Executing Scripts
As mentioned above, the
script -execute
command launches a named script file that has been
previously uploaded to the NetDefend Firewall. For example, to execute the script file
my_script.sgs
which has already been uploaded, the CLI command would be:
gw-world:/> script -execute -name=my_script.sgs
Script Variables
A script file can contain any number of
script variables
which are called:
$1
,
$2
,
$3
,
$4
......
$n
The values substituted for these variable names are specified as a list at the end of the
script
-execute
command line. The number
n
in the variable name indicates the variable value's position
in this list.
$1
comes first,
$2
comes second and so on.
Note: The symbol $0 is reserved
Notice that the name of the first variable is $1. The variable $0 is reserved and is always
replaced before execution by the name of the script file itself.
For example, a script called
my_script.sgs
is to be executed with IP address
126.12.11.01
replacing
all occurrences of
$1
in the script file and the string
If1 address
replacing all occurrences of
$2
.
The file
my_script.sgs
contains the single CLI command line:
add IP4Address If1_ip Address=$1 Comments=$2
Chapter 2: Management and Maintenance
59
Summary of Contents for NetDefendOS
Page 30: ...Figure 1 3 Packet Flow Schematic Part III Chapter 1 NetDefendOS Overview 30 ...
Page 32: ...Chapter 1 NetDefendOS Overview 32 ...
Page 144: ...Chapter 2 Management and Maintenance 144 ...
Page 284: ...Chapter 3 Fundamentals 284 ...
Page 392: ...Chapter 4 Routing 392 ...
Page 419: ... Host 2001 DB8 1 MAC 00 90 12 13 14 15 5 Click OK Chapter 5 DHCP Services 419 ...
Page 420: ...Chapter 5 DHCP Services 420 ...
Page 573: ...Chapter 6 Security Mechanisms 573 ...
Page 607: ...Chapter 7 Address Translation 607 ...
Page 666: ...Chapter 8 User Authentication 666 ...
Page 775: ...Chapter 9 VPN 775 ...
Page 819: ...Chapter 10 Traffic Management 819 ...
Page 842: ...Chapter 11 High Availability 842 ...
Page 866: ...Default Enabled Chapter 13 Advanced Settings 866 ...
Page 879: ...Chapter 13 Advanced Settings 879 ...