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