Executing an Op Script from a Remote Site
As an alternative to storing operation (op) scripts locally on the device, you can store op scripts at a remote site. This allows you to execute the scripts by specifying a URL on the command line.
To execute an op script from a remote site:
- Create the script.
- (Optional) Store the script temporarily in the
/var/tmpdirectory on the device, and run the script through one or more hash functions to calculate hash values.The Junos OS supports MD5, SHA-1, and SHA-256 hash functions.
user@host>file checksum md5 /var/tmp/script1.slaxMD5 (/var/tmp/script1.slax) = 3af7884eb56e2d4489c2e49b26a39a97
user@host>file checksum sha1 /var/tmp/script1.slaxSHA1 (/var/tmp/script1.slax) = 00dc690fb08fb049577d012486c9a6dad34212c0
user@host>file checksum sha-256 /var/tmp/script1.slaxSHA256 (/var/tmp/script1.slax) = 150bf53383769f3bfedd41fe73320777f208d4fda81230cb27b8738
- Place the script on the remote server.
- Provide the script URL and the optional hash values to the administrators who will execute the script.
- Execute the script by running the op command
and specifying the URL that points to the remote file.user@host>op url https://www.juniper.net/scripts/2009-04-01.01.slax
key md5 3af7884eb56e2d4489c2e49b26a39a97This example shows how to include the <key> option and the MD5 checksum information.
![]() | Note: If the op script is stored locally, do not include the hash key on the command line. Instead, configure the hash value by including the checksum statement at the [edit system scripts op file filename] hierarchy level. During the execution of the script, the Junos OS recalculates the checksum value using the configured hash and verifies that the calculated value matches the configured value. |
Related Topics
- Configuring Checksum Hashes for an Op Script
- file checksum md5 command in the System Basics and Services Command Reference
- file checksum sha-256 command in the System Basics and Services Command Reference
- file checksum sha1 command in the System Basics and Services Command Reference
- op command in the System Basics and Services Command Reference
Hide Navigation Pane
Show Navigation Pane
Download
SHA1
