ConfD User Community

Applying CLI commands from File


#1

hi,
in our requirement we have to apply some configuration CLI commands written in some file, whenever the device comes up with out any user intervention.

i wanted to know is there any specific functionality/API so that we can use to implement this.

thanks


#2

You can run confd_cli in a batch mode upon device startup to process your configuration CLI commands.

Following is a snippet of what is described in 16.4.1, Starting the CLI, of the ConfD User Guide:

The confd_cli program can also be used for batch processing of CLI commands, either by storing the commands in a file and running confd_cli on the file, or by having the following line at the top of the file (with the location of the program modified appropriately):
#!/bin/confd_cli

In addition, the SCRIPTING section of the man pages for confd_cli shows how to execute CLI commands in non-interactive mode from a shell script.

You can also use the confd_load command line utility to load the configuration in CLI configuration format. Refer to vol. 1 of the man pages for confd_load for more information.


#3

Can you please share the documentation?


#4

The ConfD documentation comes with the ConfD Basic distribution available for download at https://developer.cisco.com/site/confD/.