33 lines
779 B
Bash
33 lines
779 B
Bash
#!/usr/bin/expect
|
|
|
|
set USER [lindex $argv 0]
|
|
set PASSWD [lindex $argv 1]
|
|
set SSHHOST [lindex $argv 2]
|
|
|
|
spawn ssh $SSHHOST -l $USER
|
|
expect "password"
|
|
send "$PASSWD\r"
|
|
expect "continue"
|
|
send "\r"
|
|
expect "#"
|
|
send "conf\r"
|
|
expect "#"
|
|
send "ip authorized-managers 130.35.0.77 255.255.255.255 access manager\r"
|
|
expect "#"
|
|
send "ip authorized-managers 130.35.0.84 255.255.255.255 access manager\r"
|
|
expect "#"
|
|
send "ip authorized-managers 130.35.0.92 255.255.255.255 access manager\r"
|
|
expect "#"
|
|
send "ip authorized-managers 130.35.0.205 255.255.255.255 access manager\r"
|
|
expect "#"
|
|
send "ip authorized-managers 10.10.12.32 255.255.255.240 access manager\r"
|
|
expect "#"
|
|
send "wr mem"
|
|
expect "#"
|
|
send "logout\r"
|
|
expect "log out"
|
|
send "y\r"
|
|
expect eof
|
|
exit
|
|
|