]> mj.ucw.cz Git - eval.git/blob - bin/mo-create-submit
573d658423b06a312c9c0530436b2cbfb388880b
[eval.git] / bin / mo-create-submit
1 #!/bin/bash
2
3 [ -f config ] || { echo "Missing config file, check cwd." ; exit 1 ; }
4 set -e
5 . config
6 [ -n "$REMOTE_SUBMIT" ] || { echo "Remote submit not enabled." ; exit 1 ; }
7 make
8
9 echo "Creating submit directory"
10
11 H=`pwd`
12 cd $MO_ROOT/eval/submit
13 mkdir -p certs
14 cp $H/certs/server* certs/
15 cp $H/certs/ca-cert.pem certs/
16
17 rm -rf submit
18 mkdir -p submit
19 cp $H/submit/{submitd,config,show-submits} submit/
20
21 mkdir -p solutions 
22 for a in `cd $H && bin/mo-get-users` ; do
23         mkdir -p solutions/$a
24 done
25
26 rm -rf lib
27 cp -a $H/submit/lib lib
28
29 rm -rf tmp
30 mkdir -p tmp
31
32 mkdir -p log
33
34 chown -R $REMOTE_SUBMIT_USER.$REMOTE_SUBMIT_GROUP $MO_ROOT/eval/submit