How Op Scripts Work
Op scripts execute Junos OS operational commands and inspect the resulting output. After inspection, op scripts can manipulate the output or automatically correct errors within the device running Junos OS based on this output.
You enable op scripts by listing the filenames of one or more op script files within the [edit system scripts op] hierarchy level. To execute local op scripts, you must add the files to the appropriate op script directory on the device. For more information about op script file directories, see Storing and Enabling Scripts. Once added to the device, op scripts are invoked from the command line, using the op filename command.
You can also store and execute op scripts from a remote site. Remote op scripts are invoked from the command line using the op url url command. For more information about executing remote op scripts, see Executing an Op Script from a Remote Site.
You can use op scripts to generate changes to the device 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 device configuration.