Adam H wrote:
>
> Hi all:
> I have a question.
> Anyone have an idea how to automate the creation of virtual users thru a
> shell script.. So I can supply the password on the command line?
> like
> ./vadduser <account> <password>
> instead of it having to prompt me?
>
> Basiaclly I'm pulling userId's and cleartest Pw's out of an internal
> database and then submitting them to vadduser
That's a perfect application for expect, which runs under tcl. I
don't know them from a hole in the wall, but if you look at the
expect script (in the examples directory) called autopasswd, it will
take you about 30 seconds to twig what's going on and modify it to
work for vadduser, less if you've ever written a modem script.
The expect/tcl package is enormously capable and complex, but I've
installed it on two systems, once by compiling and installing
manually and once using Solaris packages (think RPM's) and both
times it was trivial. The first time I used it only for autopasswd.
I have it now because the Cyrus imapd admin software uses it.