!/usr/bin/expect
set timeout 1
set username [lindex $argv 0] set userpass [lindex $argv 1]
spawn ssh scriptguardian@remotemachine "/webadmin/htpasswd-add-user.sh $username $userpass"
expect "The authenticity of host 'remotemachine (192.168.245.245)' can't be established." expect "RSA key fingerprint is ff:38:9d:79:44:28:63:0c:ff:cd:97:22:4f:19:6f:a4." expect "Are you sure you want to continue connecting (yes/no)?"
send "yes\n"
expect "scriptguardian@remotemachine's password: "
send "THEPASSWORD\n"
interact