Tim Lindberg | c50276e | 2013-04-10 11:32:03 -0700 | [diff] [blame] | 1 | #!/usr/bin/expect -f |
2 | # ./prontolink.exp <ip of switch> <port> <0 or 1 (on or off)> | ||||
3 | set timeout -1 | ||||
4 | set arg0 [lindex $argv 0] | ||||
5 | set port [lindex $argv 1] | ||||
6 | set onoff [lindex $argv 2] | ||||
7 | |||||
8 | spawn ssh root@$arg0 | ||||
9 | expect ": " | ||||
10 | send "OpenFlow\r" | ||||
11 | expect "# " | ||||
12 | send "cli\r" | ||||
13 | expect "CLI# " | ||||
14 | send "port set $port enable=$onoff\r" | ||||
15 | expect "CLI# " | ||||
16 | send "quit\r" | ||||
17 | expect "# " | ||||
18 | send "exit\r" | ||||
19 | expect "closed." |