--- /dev/null
+#!/bin/bash
+# Create a floppy with solutions, testing logs and example solution
+# expects that mo-create-packages has been run before
+# and adds stuff in $MO_ROOT/floppy
+
+[ -n "$1" ] || { echo "Usage: mo-create-floppy <user>" ; exit 1 ; }
+USER=$1
+[ -f config ] || { echo "Missing config file, check cwd." ; exit 1 ; }
+set -e
+. config
+
+mkdosfs /dev/fd0
+mount -tvfat /dev/fd0 /mnt
+D=/mnt
+U=$MO_ROOT/users/$USER/$USER
+if [ -d $U/testing ] ; then ( cd $U ; zip -r $D/testing.zip testing ) fi
+if [ -d $U/solutions ] ; then cp -dR $U/solutions/* $D/ ; fi
+cp -dR $MO_ROOT/floppy/* $D/
+umount /mnt
+echo "Done."
--- /dev/null
+#!/bin/bash
+# Create contestant directories with their solutions and test logs
+
+[ -f config ] || { echo "Missing config file, check cwd." ; exit 1 ; }
+set -e
+. config
+
+H=`pwd`
+cd $MO_ROOT
+rm -rf users2
+mkdir users2
+cd users2
+
+for a in `awk </etc/passwd -F: '{ if ($3 >= '$CT_UID_MIN' && $3 <= '$CT_UID_MAX') print $1; }'` ; do
+ echo "Creating $a"
+ mkdir $a $a/$a
+ chown root.$a $a
+ chmod 750 $a
+ cp -a `find $H/template -type f -name ".*"` $a/$a/
+ if [ -d $H/solutions/$a ] ; then cp -a $H/solutions/$a $a/$a/solutions ; fi
+ if [ -d $H/testing/$a ] ; then cp -a $H/testing/$a $a/$a/testing ; fi
+ chown $a.$a $a/$a -R
+ chmod 700 $a/$a
+done