]> mj.ucw.cz Git - eval.git/blob - bin/mo-create-floppy
...
[eval.git] / bin / mo-create-floppy
1 #!/bin/bash
2 # Create a floppy with solutions, testing logs and example solution
3 # expects that mo-create-packages has been run before
4 # and adds stuff in $MO_ROOT/floppy
5
6 [ -n "$1" ] || { echo "Usage: mo-create-floppy <user>" ; exit 1 ; }
7 USER=$1
8 [ -f config ] || { echo "Missing config file, check cwd." ; exit 1 ; }
9 set -e
10 . config
11
12 mkdosfs /dev/fd0
13 mount -tvfat /dev/fd0 /mnt
14 D=/mnt
15 U=$MO_ROOT/users/$USER/$USER
16 if [ -d $U/testing ] ; then ( cd $U ; zip -r $D/testing.zip testing ) fi
17 if [ -d $U/solutions ] ; then cp -dR $U/solutions/* $D/ ; fi
18 cp -dR $MO_ROOT/floppy/* $D/
19 umount /mnt
20 echo "Done."