vagrant/bin/hobo-ssh-expect.sh

17 lines
242 B
Bash
Raw Normal View History

2010-01-26 08:01:17 +00:00
#!/usr/bin/expect
set uname [lrange $argv 0 0]
set password [lrange $argv 1 1]
set host [lrange $argv 2 2]
spawn ssh $uname@$host
expect "*password: " {
sleep 1
send "$password\r"
} timeout {
send_user "Error connecting"
}
interact