expect script handles the port
This commit is contained in:
parent
f4cc3d430b
commit
b11bad4788
|
@ -3,8 +3,15 @@
|
|||
set uname [lrange $argv 0 0]
|
||||
set password [lrange $argv 1 1]
|
||||
set host [lrange $argv 2 2]
|
||||
set port [lrange $argv 3 3]
|
||||
|
||||
spawn ssh $uname@$host
|
||||
if { $port != "" } {
|
||||
set port_option "-p $port"
|
||||
} else {
|
||||
set port_option ""
|
||||
}
|
||||
|
||||
spawn ssh $port_option $uname@$host
|
||||
|
||||
expect "*password: " {
|
||||
sleep 1
|
||||
|
|
Loading…
Reference in New Issue