[Contents] [Prev] [Next] [Index] [Report an Error]

How Commit Scripts Work

You enable commit scripts by listing the names of one or more commit script files at the [edit system scripts commit] hierarchy level. These scripts contain instructions that enforce custom configuration rules. Commit scripts are invoked during the commit process before the standard JUNOS validity checks are performed.

When you perform a commit operation, the JUNOS software executes each script in turn, passing the configuration through the scripts. The script inspects the configuration, performs the necessary tests and validations, and generates a set of instructions, requesting the software to perform certain actions. These actions include generating error, warning, and system log messages. If errors are generated, the commit operation fails and the candidate configuration remains unchanged. This is the same behavior that occurs with standard commit errors.

Commit scripts can also generate changes to the system configuration. Because the changes are loaded before the standard validation checks are performed, they are validated for correct syntax, just like statements already present in the configuration before the script is applied. If the syntax is correct, the configuration is activated and becomes the active, operational routing platform configuration.

Figure 3 shows the flow of commit script input and output.

Figure 3: Commit Script Input and Output

Image g017027.gif

The following sections examine several important concepts related to the commit script input and output:


[Contents] [Prev] [Next] [Index] [Report an Error]