-
Notifications
You must be signed in to change notification settings - Fork 6
/
evaluateLabs_a1.sh
executable file
·58 lines (45 loc) · 1.27 KB
/
evaluateLabs_a1.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
if [ "$1" == "-h" ]; then
echo "Evaluate ANM labs.";
echo "Usage:"
echo "$1 <labfolder>"
echo "Labfolder contains the downloaded folder from Its learning."
exit
fi
myBasedir=$(pwd)
timestr=$(date +%Y-%m-%d_%H%M)
feedbackFile="$myBasedir/Feedback".$timestr."log"
echo "Feedback will be in $feedbackFile"
myRootDir=$1
cd "$myRootDir"
echo "Going into $myRootDir"
for student in *
do
echo "[EvalLab] Checking $student; in $myRootDir"
cd "$myRootDir"
if [[ ! -e /tmp/A1 ]]; then
mkdir -p /tmp/A1;
fi
echo "[EvalLab] Cleaning /tmp/A1/"
rm -rf /tmp/A1/*
echo "[EvalLab] /tmp/A1/"
ls /tmp/A1/
echo "[EvalLab] Copying; cp -r $student/* /tmp/A1"
cp -r "$student"/* /tmp/A1
cd /tmp/A1
ls
## Remove txt||pdf from filename
rename 's/\.txt$//' *.txt
echo "********************START: $student****************"
echo $(date)
echo "********************************************"
echo "[EvalLab] Executing test for "
$myBasedir/A1/checkA1.sh
ls
echo "[EvalLab] Killing snmpd"
sudo killall snmpd
read -p "press key to continue"
echo "[EvalLab] Removing /tmp/A1 folder. "
rm -rf /tmp/A1/*
echo "********************END: $student****************"
done