02-11-2019 10:22 AM - edited 03-01-2019 02:59 AM
Hi,
I need some help to do a script to accept "Yes" from CLI
I want to do TCL Script to put this command: vrf upgrade-cli multi-af-mode common-policies vrf XXX
If i insert this command on CLI, it´ll give me:
ROUTER(config)#vrf upgrade-cli multi-af-mode common-policies vrf NAC
You are about to upgrade to the multi-AF VRF syntax commands.
You will lose any IPv6 addresses configured on interfaces
belonging to upgraded VRFs.
Are you sure ? [yes]:
My script will be something like this:
tclsh
ios_config "vrf upgrade-cli multi-af-mode common-policies vrf XXX"
...
but then i don´t know to accept the "yes".
Can someone give a suggest?
Solved! Go to Solution.
02-12-2019 08:35 AM
good to know it was solved, the document have that command syntax.
02-11-2019 11:18 AM
Look at this thread, you need to use regex to parse the output and take action based on output.
https://community.cisco.com/t5/network-management/tcl-cli-read-pattern/td-p/2261228
02-12-2019 04:26 AM
I have already looked to that thread. I'm not familiarize with this type of language. I was look for something easier.
02-12-2019 07:08 AM
I have found a solution.
tclsh
foreach VRF {
aaa
bbb
} { puts "[ ios_config "vrf upgrade-cli multi-af-mode common-policies vrf $VRF" ]" }
yes
yes
tclquit
02-12-2019 08:35 AM
good to know it was solved, the document have that command syntax.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide