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.

22 lines
626 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
if [ -L /course/$COURSE/assn/$USER ]; then
echo -e "\x1b[1;31mSkipped $USER: assn dir is a link\x1b[0m"
continue
fi
if [ ! -d /course/$COURSE/assn/$USER/$assn ]; then
echo -e "\x1b[1;31mIs not a directory\x1b[0m"
continue
fi
setfacl -R -m u:$USER:rwx /course/$COURSE/assn/$USER/$assn
chown -R $USER:$USER /course/$COURSE/assn/$USER/$assn/* 2> /dev/null
ls --color -lad /course/$COURSE/assn/$USER/$assn
done
done