blob: 0815843a5e48f839706f8437d25718a6d8cdd771 [file] [log] [blame]
#!/usr/bin/expect -f
# ./neclink.exp <ip of port> <'no' or blank>
set timeout 5
set port [lindex $argv 0]
set no [lindex $argv 1]
spawn ssh ons@10.128.0.11
expect ": "
send "onos_test\r"
expect ">"
send "enable\r"
expect ":"
send "onos_test\r"
expect "#"
send "configure\r"
expect "(config)# "
send "interface gigabitethernet 0/$port\r"
expect "if)# "
send "$no shutdown\r"
expect "# "
send "exit\r"
expect "# "
send "exit\r"
expect ": "
send "y\r"
expect "#"
send "exit\r"
expect "closed."