]> mj.ucw.cz Git - eval.git/commitdiff
Cleaned up mop/admin/.
authorMartin Mares <mj@ucw.cz>
Sun, 25 May 2008 21:19:04 +0000 (23:19 +0200)
committerMartin Mares <mj@ucw.cz>
Sun, 25 May 2008 21:19:04 +0000 (23:19 +0200)
The script still need some updates and thorough testing.

mop/admin/mo-create-contestants.sh
mop/admin/mo-create-eval.sh
mop/admin/mo-create-logins.sh
mop/admin/mo-create-public.sh
mop/admin/mo-create-submit.sh
mop/admin/mo-create-testusers.sh
mop/admin/mo-grab-remote.sh
mop/admin/mo-grab.sh
mop/admin/mo-install.sh

index 3cc44454b8cc8d937756d948c29c336d8c94a827..1de4b054a84c8926e0295def8b8dabba53b2eee0 100755 (executable)
@@ -1,8 +1,9 @@
 #!/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`
 cd $MO_ROOT
index 707053cbf3a19ea447892e9092e8c4f85020f319..0e236f08f4bfccaaba83c33e8555f394d679f0bf 100755 (executable)
@@ -1,8 +1,9 @@
 #!/bin/bash
+# Create home directory of the user who runs the evaluator.
 
-[ -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`
 cd $MO_ROOT/eval
index f6fc868cfb9b17a81a49e50539054712069d5f85..f2b4190ef96c5326ab81a6fea331ed4ee6aac555 100755 (executable)
@@ -1,8 +1,10 @@
 #!/bin/bash
+# Create /etc/shadow, /etc/passwd and /etc/group records for accounts
+# used by the evaluator and the 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
 
 mode=$1
 
@@ -56,7 +58,7 @@ case $mode in
        \\def\\user#1#2#3{\\vbox to 4.5cm{\\hsize=6cm\\vss\\vss{\\fit Practice Session}\\vss\\vss{\\frm #3}\\vss\\vss#1\\vss#2\\vss\\vss}}
        \\leavevmode
        EOF
-    
+
     bin/mo-get-users --full | while read user name; do
       passwd=`apg -n1 -m6 -Mncl | cut -d" " -f1 | tr l1O0 '@*?-' `
       passwd_md5=`echo $passwd | bin/md5crypt`
index 91c9c8e715deca1d252005ccd5b610daa40de851..3e26af77577b7dce65de6e32931b9020d08d8393 100755 (executable)
@@ -1,26 +1,29 @@
 #!/bin/bash
+# Create a directory with the public scripts from mop/public/.
 
-[ -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
 
 echo "Populating $MO_ROOT/public"
 H=`pwd`
 cd $MO_ROOT/public
-rm -rf bin lib
+rm -rf bin lib cf
 
-sed '/^\(TEST_USER\|MO_ROOT\)=/s/^/#/' <$H/config >config
+mkdir cf
+for a in eval mop ; do
+       sed '/^\(TEST_USER\|MO_ROOT\)=/s/^/#/' <$H/cf/$a >cf/$a
+done
 
 mkdir bin
-cp -a $H/public/[a-z]* bin/
-for a in `cat $H/public/COPY` ; do
-       cp -a $H/$a bin/
-done
+cp -a $H/bin/{check,submit,compile,status,box,iwrapper} bin/
+
+mkdir lib
+cp -a $H/lib/libeval.sh lib/
 
 if [ -n "$REMOTE_SUBMIT" ] ; then
-       cp $H/submit/{contest,remote-submit,remote-status} bin/
-       mkdir lib
-       cp -a $H/submit/lib .
+       cp -a $H/bin/{contest,remote-submit,remote-status} bin/
+       cp -a $H/lib/perl5 lib/
 fi
 
 mkdir -p problems
index 2d345433f382dec5af5c30657b2250cb88be212b..30056f0ecb138d873af3771b351334ea28b6d550 100755 (executable)
@@ -1,8 +1,9 @@
 #!/bin/bash
+# Create home directory of the submit server.
 
-[ -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
 [ -n "$REMOTE_SUBMIT" ] || { echo "Remote submit not enabled." ; exit 1 ; }
 
 echo "Creating submit directory"
index aec3535f287137d543e00db6f051025c8e8dbf02..42e7bfa06620961286c5e31c812f38146d32ba8f 100755 (executable)
@@ -1,8 +1,9 @@
 #!/bin/bash
+# Create accounts used by the sandbox.
 
-[ -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`
 cd $MO_ROOT/eval
index eff0ec05d9d8dfe671982a21e9cf714eed186b4d..3f1eb7e31d17482ffaf44f8e574c24886937585c 100755 (executable)
@@ -2,9 +2,9 @@
 # Grab all submits from the submit server and copy them to solutions/.
 
 [ -n "$1" ] || { echo "Usage: mo-grab-remote <tasks>" ; exit 1 ; }
-[ -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
 
 for user in `bin/mo-get-users` ; do
        echo -n "$user:"
index ad57520bd90d66b25d3198e031a9ee76f78bc5de..8bbc8fb76da62a58c46a3769718016bd7205c032 100755 (executable)
@@ -3,9 +3,9 @@
 # local machine and copy them to solutions/.
 
 [ -n "$1" ] || { echo "Usage: mo-grab <tasks>" ; exit 1 ; }
-[ -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
 
 for user in `bin/mo-get-users` ; do
        echo -n "$user:"
index f4456a943d5b8e843924c15168f964f8a3d6b6ce..e4581608fec3ea7debd3bad627db268f5e8b2009 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/bash
 
-[ -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`