forked from CS340-19/webserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeasure.sh
More file actions
executable file
·30 lines (23 loc) · 1.1 KB
/
measure.sh
File metadata and controls
executable file
·30 lines (23 loc) · 1.1 KB
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
#!/bin/bash
cd ../students
git pull
cd ../webserver
ls -f ../students/[a-z]*.md | while read i; do cat $i | \
perl -ane 'chop();print "'$i';$1\n" if m/[^1-9]*(3[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/';
done | sed 's|.*/||' > complete
nn=1
cat complete | while IFS=\; read i ip;
do echo "$nn;$i;$ip;"$(wget http://$ip -t 1 --timeout=3 -O - 2> /dev/null|perl -ane 's/\n/ /g;print');
nn=$(($nn+1))
done > complete.works
echo "# results for automatic build" > results.md
echo "|Row|netid|IP|Response|" >> results.md
echo "|--|-----|--|--------|">> results.md
sed 's/;/|/g;s/^/|/;s/$/|/' complete.works >> results.md
git add results.md
git commit -m 'Current status'
git push
git log --format="%h" | while read i; do git show $i:results.md 2> /dev/null; done | grep -v ';' | awk -F\| '{if (NF>3)print $(NF-1)";"$(NF-3)}' | sort -u | grep -v '^;' | grep -v '^-' | cut -d\; -f2 | sort -u > a
join -v2 a b
#count with nonempty response
git log --format="%h" | while read i; do git show $i:results.md 2> /dev/null; done | grep -v ';' | awk -F\| '{if (NF>3)print $(NF-1)";"$(NF-3)}' | sort -u | grep -v '^;' | grep -v '^-' | wc