]> mj.ucw.cz Git - moe.git/blob - bin/mo-create-contestants
The Big Cleanup.
[moe.git] / bin / mo-create-contestants
1 #!/bin/bash
2
3 [ -f config ] || { echo "Missing config file, check cwd." ; exit 1 ; }
4 set -e
5 . config
6
7 H=`pwd`
8 cd $MO_ROOT
9 rm -rf users
10 mkdir users
11 cd users
12
13 for a in `awk </etc/passwd -F: '{ if ($3 >= '$CT_UID_MIN' && $3 <= '$CT_UID_MAX') print $1; }'` ; do
14         echo "Creating $a"
15         mkdir $a $a/$a
16         chown root.$a $a
17         chmod 750 $a
18         cp -a `find $H/template -type f -name ".*"` $a/$a/
19         chown $a.$a $a/$a -R
20         chmod 700 $a/$a
21 done