BASH 1 script
hi all, does anyone know how to write a bash1 script that creates users, based on info from configuration files?
Or a link to a site with such information would be great. Thank you, John |
which configuration file you mean.
|
just a plain text file that has usernames, passwords, and password policies.
|
here is a sample script
----------------user.conf ----------------- name:user1 passwd:user11 name:user2 passwd:user22 ---------------------------useradd.sh----------- #!/bin/bash i=0 while read line do array[$i]=`echo $line | awk -F ":" '{print $2}'` let i=$i+1 done < user.conf for j in `seq 0 2 $(($i-1))` do /usr/sbin/useradd ${array[$j]} -p ${array[$(($j+1))]} done |
All times are GMT -5. The time now is 01:49 PM. |