Implement home exam server.
This commit is contained in:
parent
147fddc772
commit
f4f0795e80
10 changed files with 248 additions and 0 deletions
26
roles/exam_homes/files/copy2students
Executable file
26
roles/exam_homes/files/copy2students
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/bash
|
||||
#
|
||||
# Copy content to all student home download directories.
|
||||
|
||||
set -eu
|
||||
if [[ -z $@ ]] ; then
|
||||
echo "Argument missing!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
HDIRS='/home/'
|
||||
DIRS=()
|
||||
|
||||
for DIR in $(find $HDIRS -maxdepth 1 -mindepth 1 -type d) ; do
|
||||
H="$(basename $DIR)"
|
||||
if [[ "$H" =~ ^L_ ]] || [[ "$H" =~ ansible ]] ; then
|
||||
echo "Skipping home of '$H'."
|
||||
continue
|
||||
fi
|
||||
DIRS+=("$DIR")
|
||||
done
|
||||
[[ "${#DIRS[@]}" -eq 0 ]] && exit 0
|
||||
|
||||
for DIR in "${DIRS[@]}" ; do
|
||||
cp -va $@ "$DIR/Downloads/"
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue