Tim Lindberg | c50276e | 2013-04-10 11:32:03 -0700 | [diff] [blame] | 1 | #!/usr/bin/expect -f |
2 | # ./neclink.exp <ip of port> <'no' or blank> | ||||
3 | set timeout -1 | ||||
4 | set port [lindex $argv 0] | ||||
5 | set no [lindex $argv 1] | ||||
6 | |||||
7 | spawn ssh ons@10.128.0.11 | ||||
8 | expect ": " | ||||
9 | send "onos_test\r" | ||||
10 | expect ">" | ||||
11 | send "enable\r" | ||||
12 | expect ":" | ||||
13 | send "onos_test\r" | ||||
14 | expect "#" | ||||
15 | send "configure\r" | ||||
16 | expect "(config)# " | ||||
17 | send "interface gigabitethernet 0/$port\r" | ||||
18 | expect "if)# " | ||||
19 | send "$no shutdown\r" | ||||
20 | expect "# " | ||||
21 | send "exit\r" | ||||
22 | expect "# " | ||||
23 | send "exit\r" | ||||
24 | expect ": " | ||||
25 | send "y\r" | ||||
26 | expect "#" | ||||
27 | send "exit\r" | ||||
28 | expect "closed." |