Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/local/bin/expect -f
- spawn adduser
- expect "Username:"
- send "[lindex $argv 0]\r"
- expect "Full name:"
- send "[lindex $argv 1]\r"
- expect "Uid (Leave empty for default):"
- send "\r"
- expect "Login group"
- send "clients\r"
- expect "Login group is clients."
- send "\r"
- expect "Login class"
- send "\r"
- expect "Shell"
- send "rssh\r"
- expect "Home Directory \[/home/[lindex $argv 0]\]:"
- send "\/usr\/local\/www\/[lindex $argv 0]\r"
- expect "Home Directory Permissions"
- send "\r"
- expect "Use password-based authentication"
- send "\r"
- expect "Use an empty password"
- send "no\r"
- expect "Use a random password"
- send "no\r"
- expect "Enter password:"
- send "[lindex $argv 2]\r"
- expect "Enter password again:"
- send "[lindex $argv 2]\r"
- expect "Lock out the account after creation"
- send "no\r"
- expect "OK?"
- send "yes\r"
- expect "Add another user"
- send "no\r"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement