diff --git a/code/l2switch/reset-tcl.txt b/code/l2switch/reset-tcl.txt index b218904..0c3c987 100644 --- a/code/l2switch/reset-tcl.txt +++ b/code/l2switch/reset-tcl.txt @@ -1,15 +1,26 @@ tclsh puts [ open "flash:reset.tcl" w+ ] { -typeahead "\n" -copy running-config startup-config -typeahead "\n" -erase startup-config -delete /force vlan.dat -delete /force multiple-fs -ios_config "sdm prefer lanbase-routing" -typeahead "\n" -puts "Reloading the switch in 1 minute, type reload cancel to halt" -typeahead "\n" -reload in 1 RESET.TCL SCRIPT RUN + +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 [ ios_config "sdm prefer lanbase-routing" ] +puts "Changing prefered sdm to lanbase-routing" +typeahead "r" + +puts [ exec "copy flash:base.cfg nvram:startup-config" ] +puts "Reloading the layer 2 switch" +typeahead "r" + +puts [ exec "reload" ] +} } tclquit diff --git a/code/l3switch/reset-tcl.txt b/code/l3switch/reset-tcl.txt index 9aa840c..09939c9 100644 --- a/code/l3switch/reset-tcl.txt +++ b/code/l3switch/reset-tcl.txt @@ -1,15 +1,26 @@ tclsh puts [ open "flash:reset.tcl" w+ ] { -typeahead "\n" -copy running-config startup-config -typeahead "\n" -erase startup-config -delete /force vlan.dat -delete /force multiple-fs -ios_config "sdm prefer dual-ipv4-and-ipv6 routing" -typeahead "\n" -puts "Reloading the switch in 1 minute, type reload cancel to halt" -typeahead "\n" -reload in 1 RESET.TCL SCRIPT RUN + +puts "Erasing Configuration" +typeahead "r" + +puts [ exec "write erase" ] +puts "Erasing VLAN Database" +typeahead "r" + +puts [ exec "delete flash:vlan.dat" ] +puts "Copying Base Configuration To Startup" +typeahead "r" + +puts [ ios_config "sdm prefer dual-ipv4-and-ipv6 routing" ] +puts "Changing prefered sdm to dual-ipv4-and-ipv6 routing" +typeahead "r" + +puts [ exec "copy flash:base.cfg nvram:startup-config" ] +puts "Reloading the layer 3 switch" +typeahead "r" + +puts [ exec "reload" ] } -tclquit \ No newline at end of file +} +tclquit