Implementing Op Scripts
To use op scripts on a switch, router, or security device, follow these steps:
- Write the op script. For information about writing op scripts, see Writing Op Scripts. For examples, see Op Script Examples.
- Copy the script to the
/var/db/scripts/opdirectory on the hard drive or the/config/scripts/opdirectory on the flash drive. For information about setting the storage location for scripts, see Storing Op Scripts in Flash Memory. Only users who belong to the Junos OS super-user login class can access and edit files in these directories.
Note: If the device has dual Routing Engines and you want to enable the op script to execute on both Routing Engines, you must copy the script to the
/var/db/scripts/opor/config/scripts/opdirectory on both Routing Engines. The commit synchronize command does not automatically copy scripts between Routing Engines. - Enable the script by including the file filename statement at the [edit system scripts op] hierarchy level. For instructions, see Enabling an Op Script and Defining a Script Alias.
- Issue the commit command.
After the commit operation completes, the op script can be executed on the device. See Executing an Op Script.
Hide Navigation Pane
Show Navigation Pane
Download
SHA1