On Monday 29 December 2003 16:06, Tom Tu wrote:

> Does anyone have a script that will add or delete email accounts in
> vpopmail given a static file with the email address of each user we want to
> add or delete?

        Written for the first time at this e-mail, I've never run this before:

--- cut here ---

if [ "$1" == "" ]; then
        echo -n "Filename: "
        read FILE

for LINE in `cat $FILE`; do
        PROC=`echo $LINE | cut -d: -f1`
        EMAIL=`echo $LINE | cut -d: -f2`
        PASS=`echo $LINE | cut -d: -f3`
        if [ "$PROC" == "ADD" ]; then
                vadduser $EMAIL $PASS
        elif [ $PROC == "DEL" ]; then
                vdeluser $EMAIL
        echo "$EMAIL done"
--- cut here ---

        File input format:


        Each account should be written on an empty line.
        You can select this file as a parameter at the command line or wait for the 
script asks you. ;)

                [[]]'s Eduardo M. Bragatto

PS: any corrections in case of errors are welcome.

Reply via email to