shell script for nessus-adduser

I took a stab at writing a script to automate the interactive process of adding users to Nessus - I have zero previous coding experience. So far, it doesn't get me anywhere.

I took small sections of code from posts I found on this site and others: http://bash.cyberciti.biz/security/expect-ssh-login-script

This is the code I have so far. When run, it seems to execute the nessus-adduser command/script, but doesn't supply any information (ie. login/pass) back. I simply get the "Login:" prompt, same as if i ran ./nessus-adduser.

#!/bin/sh
#!/usr/bin/expect -f

PATH=/use/bin:/opt/nessus/sbin

#Set Variables

set login "nessus2"
set auth "pass"
set password "ten2"

#Add user command
nessus-adduser

expect "*?ogin :*"
send -- "$login\r"

expect "*?uthentication (pass/cert) [pass] :*"
send -- "$auth\r"

expect "*?ogin password :*"
send -- "$password\r"

expect "*?ogin password (again) :*"
send -- "$password\r"

expect "*?hit ctrl-D to create user :"

send -- ctrl+d

expect "*?s that ok ? (y/n) [y]*"

send -- "\r"

send -- "\r"

expect eof

I'm adding the same account across 20 scanners and intended to include this code in an OS hardening script.

Could someone take a look and point me in the right direction? Many thanks!

See this post for solution: