#!/bin/bash -x
PATH=/bin:/sbin:/usr/sbin:/usr/bin
export PATH

for i in `cat userlist`
do
	u=`echo ${i} | awk -F ':' '{print $1}'`
	p=`echo ${i} | awk -F ':' '{print $2}'`
	g=`echo ${i} | awk -F ':' '{print $3}'`
	useradd -g ${g} ${u}; echo ${p} | passwd --stdin ${u}
done
