blob: 501cccd34e1ef9c18e2028048286a263fc47bb21 [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)>
Tim Lindbergd2e57142013-05-13 22:59:13 -07003set timeout 5
Tim Lindbergc50276e2013-04-10 11:32:03 -07004set 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."