When I do show address as below:
show address | display set
set address a1 ipv4 3.3.3.3/32
set address a2 ipv4 1.1.1.1/32
[ok][2016-06-20 19:40:31]
I see everything in set format.
But Why cant I load the file containing 2 lines below using confd_cli. Is there a way (directly/indirectly) to load “set” commands from file directly?
set address a1 ipv4 3.3.3.3/32
set address a2 ipv4 1.1.1.1/32
I am trying confd_load -l -m -F j b.conf but its not working. Our currrent configuration as all the commands stored in “set” format. What way can we have to save and then load back the configuration in “set” format.
confd_load doesn’t generate “set” commands. It’s either XML, JSON or CLI output format. The format you specified will load or output J style CLI output of the configuration, similar to when you do a “show configuration”.
But you can generate a list of set commands that correspond to your configuration and store them in a file. Example (In the configuration mode):
% show dhcp | display set | save test
But I don’t seem to find any utility for you to load these commands.
One way would be to write a script that loads set commands and you can do something similar to:
#!/bin/sh
confd_cli << EOF
configure
set foo bar 13
set funky stuff 44
commit
exit no-confirm
exit
EOF