Batch mode is used when CLI commands are run from a file as described in the following bulleted list:
• CLI commands can be saved in a plain text file and executed in batch mode by invoking the CLI utility with the -f file option.
• CLI commands can be used in any kind of shell script:
•
• For a very simple example, you could create a script that calls /bin/CLI to run in batch mode to configure a hostname for the OnSite as shown in the following screen example.To run a CLI command from the same script that is running other Linux commands, you could put the command in another type of shell script. The bash shell is shown in the following example:.
To run multiple CLI commands from a script that is also running other Linux commands, you could add the multiple CLI commands as shown in the following example:.
/bin/CLI << EOFconfig network hostsettings hostname FremontCAOnSiteconfig security adduser username testuserYou could then make the script executable and execute it on the command line, as shown in the following screen example.
Alternately, you can put one or more commands in a plain text file without invoking any shell as shown in the following screen example.
After you save and quit the file, you can invoke the CLI command with the
-f file option to execute the command(s) from the file, as shown in the following example.