From b11bad47889720c2e5e1e1800d5140c6575ccddc Mon Sep 17 00:00:00 2001 From: John Bender Date: Sat, 30 Jan 2010 00:14:39 -0800 Subject: [PATCH] expect script handles the port --- script/hobo-ssh-expect.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/script/hobo-ssh-expect.sh b/script/hobo-ssh-expect.sh index 9efaaf411..82b1dd268 100755 --- a/script/hobo-ssh-expect.sh +++ b/script/hobo-ssh-expect.sh @@ -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