Shell script

Brian Densmore DensmoreB at ctbsonline.com
Wed Nov 12 21:51:16 CST 2003


> -------------------------------------------------
> #!/bin/sh
> 
> myprocedure () {
>    local IFS='  '       
>    while read USER PASS JUNK
>    do
>      adduser -g ftp -s /etc/ftponly -d
> 	/var/www/html/web.domain.com/./$USER $USER
>      echo $USER:$PASS |chpasswd
>      chown $USER:ftp /var/www/html/web.domain.com/$USER
>      chmod 705 /var/www/html/web.domain.com/$USER
>    done
> }
> 
> myprocedure < userlist
> 
A question! I'm just curious, but
shouldn't this be written in such a way to do a sudo rather 
than make this a root owned script? I mean root owned scripts
are a generally a bad thing right?
I like this script better too. It's self-documenting with the use
of the named variables and doesn't use the more arcane set
command.

Brian




More information about the Kclug mailing list