-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUpdateDocs.sh
executable file
·55 lines (42 loc) · 1.04 KB
/
UpdateDocs.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
#!/bin/bash
targets=( "Technologien" "Quellen.bib" "3D_Zustand.tex" "Forschung.tex" "Auswirkungen.tex" "Einleitung.tex" "Facharbeit.tex" "Facharbeit.pdf" "Titelblatt.tex" "Schlusserklarung.tex" "Logo.png" )
makeURLLists() {
cd Facharbeit
rm -f URLLIST
rm -f NAMELIST
echo "Generating webpage-lists!"
# Generate NAMEs
cat Facharbeit.bbl | grep "\field{title}" | tr '[ }]' '_' | cut -c 21- >> NAMELIST
# Generate URLs
cat Facharbeit.bbl | grep "\\verb " | cut -c 12- >> URLLIST
cd ..
}
downloadWebs() {
URLList=(`cat Facharbeit/URLLIST`)
NAMEList=(`cat Facharbeit/NAMELIST`)
rm -f URLLIST
rm -f NAMELIST
i=0
for NAME in ${NAMEList[@]} ; do
echo "Downloading $NAME now!"
echo "URL: ${URLList[$i]}"
wget -O DOCS/WEBSITEN/$NAME.html "${URLList[$i]}" -q
i=`expr $i + 1`
done
}
copyContents() {
for i in ${targets[@]} ; do
echo "Copying $i now!"
cp -r Facharbeit/$i DOCS/Facharbeit/
done
}
genZip() {
rm DOCS.zip
zip -r DOCS.zip DOCS/*
}
if [[ $1 = "all" ]]; then
makeURLLists
downloadWebs
fi
copyContents
genZip