Blog Viewer

Scripting How-To: Commit Op scripts in private mode

By tmoovana posted 02-12-2016 14:27

  

Overview

This topic describes how to commit Op scripts in private mode.

 

Example Configuration

 

This example shows how you commit an Op script in a private configuration session.

 

 var $connection = jcs:open();
var $edit-private = <open-configuration> { <private>; }
/* adding the log message is optional, but considerate */
var $commit-config = <commit-configuration> { <log> "Changed by script: " _ $script; }
var $configuration = <load-configuration> {
     <configuration> {
        /* stuff goes here */
    }
/* please check/report on errors or warnings on each of $res1-4 */
var $res1 = jcs:execute( $connection, $edit-private );    /* open private session */
var $res2 = jcs:execute( $connection, $configuration );   /* load your config change */
 var $res3 = jcs:execute( $connection, $commit-config );  /* commit your config */
 var $res4  = jcs:execute( $connection, 'close-configuration' );  /* close up */
 expr jcs:close( $connection );    /* may not be needed if script is exiting here */
}

 


#opscript
#How-To
#Slax
#ScriptingHow-To

Permalink