The script still need some updates and thorough testing.
#!/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
#!/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
#!/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
\\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`
#!/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
#!/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"
#!/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
# 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:"
# 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:"
#!/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`