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> |
Tim Lindberg | d2e5714 | 2013-05-13 22:59:13 -0700 | [diff] [blame] | 3 | set timeout 5 |
Tim Lindberg | c50276e | 2013-04-10 11:32:03 -0700 | [diff] [blame] | 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." |