SUMMARY: Re: Shell Script to add multiple users with same password

From: Simran Hansrai <sparc_at_pacbell.net>
Date: Tue Feb 25 2003 - 22:29:57 EST
Much thanks to eveyones response regarding this question.  I have 
included the small script that I wrote to take care of this problem. 
 Any suggestions or comments would be appreciated.

Thanks again,
Simran

_________________________________________________________________
#!/bin/sh

ALPHA=$1
count=$2
NUM2=$3
UID=1002

while [ $count -le $NUM2 ]
do
        echo "$1$count:x:$UID:1:User 
$1$count:/export/home/$1$count:/bin/sh" >> /etc/passwd
        echo "$1$count:WafjZ5pUd5j7U:::::::" >> /etc/shadow
        mkdir /export/home/$1$count
        cp /etc/skel/local.login /export/home/$1$count/.login
        cp /etc/skel/local.profile /export/home/$1$count/.profile
        cp /etc/skel/local.cshrc /export/home/$1$count/.cshrc
        chown -R $1$count:1 /export/home/$1$count
        count=`expr $count + 1`
        UID=`expr $UID + 1`
done
_________________________________________________________________

Simran Hansrai wrote:

> Hi Guys,
>
> I have looked everywhere but I am not able to find such a script.  Any 
> suggestions or ideas would be gratelly appreciated, or any links to 
> exsisting scripts would be perfect.
>
> I am trying to get a script that would do the following:
>
> #script r # #
>
> It will accept 3 arguments at the command line.  The first is just a 
> alphabet and the other 2 are numbers. 
> example:
> #script r 1021 1082
>
> with that command the script will create accounts for users: r1021 
> through users r1082 with the same passwords.  No error checking is 
> really needed.  Any suggestions or ideas are again very appreciated.
>
> Thanks in advance,
> Simran
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Thu Feb 27 11:55:03 2003

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:04 EST