X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=mop%2Fadmin%2Fmo-create-contestants.sh;h=d094a3150d2b067bdc06c3a0c2ebc05dca016009;hb=51733944f43d682c3c2b82f66c4f253ef9b1a6ea;hp=3cc44454b8cc8d937756d948c29c336d8c94a827;hpb=fc833e30d9b1315ffdeb780d5257e8e1bdafad43;p=eval.git diff --git a/mop/admin/mo-create-contestants.sh b/mop/admin/mo-create-contestants.sh index 3cc4445..d094a31 100755 --- a/mop/admin/mo-create-contestants.sh +++ b/mop/admin/mo-create-contestants.sh @@ -1,10 +1,21 @@ #!/bin/bash +# Create home directories of all contestants. -[ -f config ] || { echo "Missing config file, check cwd." ; exit 1 ; } +[ -f cf/mop ] || { echo "Missing config file, check cwd." ; exit 1 ; } set -e -. config +. cf/mop H=`pwd` +if [ ! -d template ] ; then + if [ -d ../mop/template ] ; then + echo "Symlinking templates from ../mop/template" + ln -s ../mop/template . + else + echo "Templates not found!" + exit 1 + fi +fi + cd $MO_ROOT rm -rf users mkdir users @@ -15,7 +26,7 @@ for a in `cd $H && bin/mo-get-users` ; do mkdir $a $a/$a chown root.$a $a chmod 750 $a - cp -a `find $H/template -mindepth 1 -maxdepth 1` $a/$a/ + cp -a `find $H/template/ -mindepth 1 -maxdepth 1` $a/$a/ if [ -n "$REMOTE_SUBMIT" ] ; then M=$a/$a/.mo