#!/usr/bin/expect -f
set user [lindex $argv 0]
set ip [lindex $argv 1]
spawn ssh $user@$ip
set timeout 2
expect {
"*(yes/no)*"
{
send "yes\r";
expect {
"*assword:*" {exit 1}
exit 0
}
}
"*assword:*" {exit 1}
}
exit 0
#!/usr/bin/expect -f
set user [lindex $argv 0]
set ip [lindex $argv 1]
spawn ssh $user@$ip
set timeout 2
expect {
"*(yes/no)*"
{
send "yes\r";
expect {
"*assword:*" {exit 1}
exit 0
}
}
"*assword:*" {exit 1}
}
exit 0