]> mj.ucw.cz Git - moe.git/blobdiff - mop/admin/mo-create-contestants.sh
Fixed pipeline.insert args order
[moe.git] / mop / admin / mo-create-contestants.sh
index 3cc44454b8cc8d937756d948c29c336d8c94a827..d094a3150d2b067bdc06c3a0c2ebc05dca016009 100755 (executable)
@@ -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