Course Management Scripts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
871 B

#!/bin/bash
[ -z "$COURSE" ] && echo "Needs a COURSE set" && exit 1
[ -z "$1" ] && echo "Needs an assignment name" && exit 1
while read USER; do
echo -n "$USER: "
for assn in $*; do
echo -e "\x1b[1;36m$assn:\x1b[0m"
if [ ! -d /course/$COURSE/assn/$USER/$assn ]; then
echo -e "\x1b[1;31mIs not a directory\x1b[0m"
continue
fi
if [ -L /course/$COURSE/assn/$USER ]; then
echo -e "\x1b[1;31mSkipped $USER: assn dir is a link\x1b[0m"
continue
fi
chown -R $USER:$USER /course/$COURSE/assn/$USER/$assn/* #/course/$COURSE/assn/$USER/$assn/.*
chown root:admin /course/$COURSE/assn/$USER /course/$COURSE/assn/$USER/$assn
#setfacl -m u:$USER:rx -m d:u::rwx -m d:g::rwx -m d:g:admin:rwx -m d:o:0 /course/$COURSE/assn/$USER/$assn
chmod 770 /course/$COURSE/assn/$USER/$assn
ls --color -lad /course/$COURSE/assn/$USER/$assn
echo "done"
done
done