+++ /dev/null
-#!/usr/bin/expect
-
-set host [lrange $argv 0 0]
-if { $host == "" } {
- puts "usage: configure_switch_bootstrap.tcl \[sw1|sw2|swg1|swg2|swm\]"
- exit 1
-}
-
-set ipaddress ""
-if { $host == "swg1" } { set ipaddress "10.133.26.231" }
-if { $host == "swg2" } { set ipaddress "10.133.26.232" }
-if { $host == "swm" } { set ipaddress "10.133.28.231" }
-if { $host == "sw1" } { set ipaddress "10.133.26.231" }
-if { $host == "sw2" } { set ipaddress "10.133.26.232" }
-if { $ipaddress == "" } { puts "unknown switch '$host'""; exit 1 }
-
-spawn screen -c . /dev/ttyUSB0
-
-set timeout 5
-
-set state 0
-while { $state != 1 } {
- expect {
- timeout { send "\r" }
- -exact ">" { send "enable\r" }
- "#" { set state 1 }
- "Password:" { send "thales\r" }
- eof { send_user "connection to host failed\n"; exit 1 }
- }
-}
-
-send "configure terminal\r"
-expect "#" { send "interface vlan 1\r" }
-expect "#" { send "ip address $ipaddress 255.255.255.0\r" }
-expect "#" { send "exit\r" }
-expect "#" { send "line vty 0 4\r" }
-expect "#" { send "password thales\r" }
-expect "#" { send "enable password thales\r" }
-expect "#" { send "end\r" }
-
-# quit switch connection
-expect "#" { send "exit\r" }
-
-# to quit screen we need to send C-a \.
-send "\001\\"
-expect "kill all your windows" { send "y\r" }
-
-exit 0
-# vim:set tabstop=4 expandtab shiftwidth=4: