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