Trigger Commands
©2008 Allied Telesis Inc. All rights reserved.
Software Version 5.2.1
AlliedWare Plus
TM
Operating System Software Reference C613-50003-00 REV E
61.7
script
This command specifies one or more scripts that are to be run when the trigger activates. You
can add up to five scripts to a single trigger.
The sequence in which the trigger runs the scripts is specified by the number you set before
the name of the script file. All dependent actions should be in the same script, as it cannot be
guaranteed that a script’s action will be completed before the next script activates.
Scripts may be either ASH shell scripts, indicated by a .sh suffix, or AlliedWare Plus
configuration scripts, indicated by a .cfg suffix. Configuration scripts only need to be readable.
The
no
parameter removes one or more scripts from the trigger’s script list. The scripts are
identified by either their name, or by specifying their position in the script list. The
all
parameter removes all scripts from the trigger.
Syntax
script
<1-5> {
<filename>
}
no script
{<1-5>|
<filename>
|
all
}
Mode
Trigger mode.
Examples
To configure trigger 71 to run the script flash:/cpu_trig.sh in position 3 when the trigger
activates, use the commands:
awplus(config)#
trigger 71
awplus(config-trigger)#
script 3 flash:/cpu_trig.sh
To configure trigger 99 to run the scripts flash:reconfig.cfg, flash:cpu_trig.sh and flash:email.cfg in
positions 2, 3 and 5 when the trigger activates, use the following commands:
awplus(config)#
trigger 99
awplus(config-trigger)#
script 2 flash:/reconfig.cfg 3 flash:/
cpu_trig.sh 5 flash:/email.cfg
To remove the scripts 1, 3 and 4 from trigger 71’s script list, use the commands:
awplus(config)#
trigger 71
awplus(config-trigger)#
no script 1 3 4
To remove the script flash:/cpu_trig.sh from trigger 71’s script list, use the commands:
awplus(config)#
trigger 71
awplus(config-trigger)#
no script flash:/cpu_trig.sh
Parameter
Description
<1-5>
The position of the script in execution sequence. The trigger runs the
lowest numbered script first. All dependent actions should be in the same
script, as it cannot be guaranteed that a script’s action will be completed
before the next script activates.
<filename>
The path to the script file.