#!/usr/bin/expect 
set timeout -1
set ip [lindex $argv 0]
set name [lindex $argv 1]
set pass [lindex $argv 2]
set src [lindex $argv 3]
set dst [lindex $argv 4]
spawn scp -r $src $name@$ip:$dst 
expect {
    "password" {send "$pass\r";}
    "yes/no" {send "yes\r";exp_continue}
}
expect eof
exit
