Enabling an Op Script and Defining a Script Alias
After you write an op script, you must save it the
/var/db/scripts/opdirectory on the routing platform. Op scripts in the/var/db/scripts/opdirectory are ignored if they are not enabled. Only users in the superuser JUNOS login class can access and edit files in the/var/db/scripts/opdirectory.If a platform has dual Routing Engines and you want the script to take effect on both Routing Engines, you must copy the script to the
/var/db/scripts/opdirectory on each Routing Engine. Thecommit synchronizecommand does not automatically copy the scripts from one Routing Engine directory into the other Routing Engine directory.To enable an op script, include the
filestatement at the[edit system scripts op]hierarchy level, specifying the name of an Extensible Stylesheet Language Transformations (XSLT) file containing an op script.The optional
commandstatement allows you to specify an alias for the filename of the script. Thus, you can run the script by invoking either the filename (with or without the.xslextension) or the filename alias.[edit systemscriptsop]filefilename.xsl{commandfilename-alias;)