#!/bin/bash

ARRAY=("fantasia" "nwpu" "kylinsky" "cit3d" "jmu" "yushan" "aua" "seuredsun" "taiji" "gstar" "buptrobot" "apollo3d" "dreamwing" "strive3d" "hs" "hfutengine" "nevermore" "nq" "af")

for((i=0;i<19;i++))
do
	pass=$(cat /dev/urandom|tr -dc "0-9"|fold -w 7|head -1)
	useradd -m -u $(($i+1001)) ${ARRAY[$i]}
	echo $pass | passwd --stdin ${ARRAY[$i]} > /dev/null
	mkdir -p /var/log/robocup/${ARRAY[$i]}/log
	ln -s /var/log/robocup/${ARRAY[$i]}/log /home/${ARRAY[$i]}/log
	chown -R ${ARRAY[$i]}:${ARRAY[$i]} /var/log/robocup/${ARRAY[$i]}

	echo
	echo "Username: ${ARRAY[$i]}"
	echo "Password: $pass"
	echo "Please use yppasswd to change your password."
done 

