]> mj.ucw.cz Git - moe.git/blob - mop/admin/mo-create-public.sh
MO: Limit character set of created passwords
[moe.git] / mop / admin / mo-create-public.sh
1 #!/bin/bash
2 # Create a directory with the public scripts from mop/public/.
3
4 [ -f cf/mop ] || { echo "Missing config file, check cwd." ; exit 1 ; }
5 set -e
6 . cf/mop
7
8 echo "Populating $MO_ROOT/public"
9 H=`pwd`
10 cd $MO_ROOT/public
11 rm -rf bin lib cf
12
13 mkdir cf
14 for a in eval mop ; do
15         sed '/^\(TEST_USER\|MO_ROOT\)=/s/^/#/' <$H/cf/$a >cf/$a
16 done
17
18 mkdir bin
19 cp -aL $H/bin/{check,submit,compile,status,box,iwrapper} bin/
20
21 mkdir lib
22 cp -aL $H/lib/libeval.sh lib/
23
24 if [ -n "$REMOTE_SUBMIT" ] ; then
25         cp -aL $H/bin/{contest,remote-submit,remote-status} bin/
26         cp -aL $H/lib/perl5 lib/
27 fi
28
29 mkdir -p problems
30
31 if [ `id -u` == 0 ] ; then
32         chown -R $EVAL_USER.$EVAL_GROUP .
33         chmod 755 .
34 fi