]> mj.ucw.cz Git - moe.git/blob - bin/mo-grab
Added --force.
[moe.git] / bin / mo-grab
1 #!/bin/bash
2
3 [ -n "$1" ] || { echo "Usage: mo-grab <tasks>" ; exit 1 ; }
4 [ -f config ] || { echo "Missing config file, check cwd." ; exit 1 ; }
5 set -e
6 . config
7
8 for user in `bin/mo-get-users` ; do
9         echo -n "$user:"
10         H=`eval echo ~$user`/.submit
11         if [ -d $H ] ; then
12                 [ -d solutions/$user ] || mkdir -p solutions/$user
13                 for t in $@ ; do
14                         rm -rf solutions/$user/$t
15                         if [ -d $H/$t ] ; then
16                                 echo -n " $t"
17                                 cp -dr $H/$t solutions/$user/$t
18                         fi
19                 done
20                 echo
21         else
22                 echo " ---"
23         fi
24 done
25 chown -R $EVAL_USER solutions
26 chmod -R a+r solutions