cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
587
Views
0
Helpful
1
Replies

tclsh script not working like I want it to...

Steven Williams
Level 4
Level 4

Using this script, when I execute it, it stops at Erasing VLAN Database and sits there until I hit enter again, then it finishes the script and reloads the device. Thoughts on why?

tclsh

puts [open "flash:reset.tcl" w+] {

puts "Erasing Configuration"

typeahead "\r"

puts [ exec "write erase" ]

puts "Erasing VLAN Database"

typeahead "\r"

puts [ exec "del flash:vlan.dat" ]

puts "Copying Base Configuration To Startup"

typeahead "\r"

puts [ exec "copy flash:baseline.cfg nvram:startup-config" ]

puts "Reloading The Device"

typeahead "\r"

puts [ exec "reload" ]

}

1 Reply 1

tomas edwards
Level 1
Level 1

Did you tried adding another carriage return?

typeahead "\r\r"

I tested your original script in a switch and it worked.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: