-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.sh
executable file
·236 lines (214 loc) · 4.85 KB
/
build.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
#! /bin/sh
#
# All routers (Gluon 2015.1.2) Freifunk Fulda
#
ROUTERS="\
buffalo-wzr-hp-ag300h-wzr-600dhp \
buffalo-wzr-hp-g450h \
d-link-dir-615-rev-c1 \
d-link-dir-825-rev-b1 \
gl-inet-6408a-v1 \
gl-inet-6416a-v1 \
linksys-wrt160nl \
netgear-wndr3700 \
netgear-wndr3700v2 \
netgear-wndr3700v4 \
netgear-wndr3800 \
netgear-wndr4300 \
netgear-wndrmacv2 \
tp-link-cpe210-v1.0 \
tp-link-cpe220-v1.0 \
tp-link-cpe510-v1.0 \
tp-link-cpe520-v1.0 \
tp-link-cpe210-eu \
tp-link-cpe510-eu \
tp-link-tl-mr3020-v1 \
tp-link-tl-mr3040-v1 \
tp-link-tl-mr3040-v2 \
tp-link-tl-mr3220-v1 \
tp-link-tl-mr3220-v2 \
tp-link-tl-mr3420-v1 \
tp-link-tl-mr3420-v2 \
tp-link-tl-wa701n-nd-v1 \
tp-link-tl-wa701n-nd-v2 \
tp-link-tl-wa750re-v1 \
tp-link-tl-wa801n-nd-v1 \
tp-link-tl-wa801n-nd-v2 \
tp-link-tl-wa801n-nd-v3 \
tp-link-tl-wa830re-v1 \
tp-link-tl-wa830re-v2 \
tp-link-tl-wa850re-v1 \
tp-link-tl-wa860re-v1 \
tp-link-tl-wa901n-nd-v2 \
tp-link-tl-wa901n-nd-v3 \
tp-link-tl-wdr3500-v1 \
tp-link-tl-wdr3600-v1 \
tp-link-tl-wdr4300-v1 \
tp-link-tl-wdr4900-v1 \
tp-link-tl-wr703n-v1 \
tp-link-tl-wr710n-v1 \
tp-link-tl-wr740n-nd-v1 \
tp-link-tl-wr740n-nd-v3 \
tp-link-tl-wr740n-nd-v4 \
tp-link-tl-wr740n-nd-v5 \
tp-link-tl-wr741n-nd-v1 \
tp-link-tl-wr741n-nd-v2 \
tp-link-tl-wr741n-nd-v4 \
tp-link-tl-wr741n-nd-v5 \
tp-link-tl-wr743n-nd-v1 \
tp-link-tl-wr743n-nd-v2 \
tp-link-tl-wr841n-nd-v3 \
tp-link-tl-wr841n-nd-v5 \
tp-link-tl-wr841n-nd-v7 \
tp-link-tl-wr841n-nd-v8 \
tp-link-tl-wr841n-nd-v9 \
tp-link-tl-wr842n-nd-v1 \
tp-link-tl-wr842n-nd-v2 \
tp-link-tl-wr941n-nd-v2 \
tp-link-tl-wr941n-nd-v3 \
tp-link-tl-wr941n-nd-v4 \
tp-link-tl-wr941n-nd-v5 \
tp-link-tl-wr1043n-nd-v1 \
tp-link-tl-wr1043n-nd-v2 \
tp-link-tl-wr2543n-nd-v1 \
ubiquiti-bullet-m \
ubiquiti-loco-m-xw \
ubiquiti-loco-m \
ubiquiti-nanostation-m-xw \
ubiquiti-nanostation-m \
ubiquiti-picostation-m \
ubiquiti-rocket-m \
ubiquiti-unifi-ap-pro \
ubiquiti-unifi \
ubiquiti-unifiap-outdoor \
x86-generic.img \
x86-kvm.img \
x86-virtualbox.vdi \
x86-vmware.vmdk \
xiaomi-miwifi-mini"
#
# for quick testing
#
ROUTsddERS="\
tp-link-tl-mr3020-v1 \
tp-link-tl-mr3040-v1 \
tp-link-tl-mr3040-v2 \
tp-link-tl-mr3220-v1 \
tp-link-tl-mr3220-v2 \
tp-link-tl-mr3420-v1 \
tp-link-tl-mr3420-v2"
#
# count the amount of routers for display progress at the pdf-building
#
should=0
is=0
for routers in `echo $ROUTERS`
do
should=`expr $should + 1`
done
echo "==============================================";
echo " Building pdf files for the different routers"
echo "==============================================";
#
for routers in `echo $ROUTERS`
do
#
# remove LaTeX files from last router
#
rm *.log 1>/dev/null 2>&1 ;
rm -R _minted* 1>/dev/null 2>&1 ;
rm *.out 1>/dev/null 2>&1 ;
rm *.aux 1>/dev/null 2>&1 ;
rm *.synctex.gz 1>/dev/null 2>&1 ;
clear;
# echo "";
# Displays the actual routername which is in progress
# echo " $routers ";
# source path
source="./router/"
# definition of the file suffixes
texsuffix=".tex"
pdfsuffix=".pdf"
stysuffix=".sty"
# definition of the source and outputfile
texfile=$routers$texsuffix
pdffile=$routers$pdfsuffix
# definition subfolderpath's
router="router"
routerfile=$router$stysuffix
specsPath1="$source$routers"
# specification texfile
specsPath2="/specs.tex"
# front picture of the router as pdf
frontpath1="/front.pdf"
# back picture of the router as pdf
frontpath2="/back.pdf"
# definition of the filepath's
specsPath=$specsPath1$specsPath2
frontpath=$specsPath1$frontpath1
backpath=$specsPath1$frontpath2
switchpath=$specsPath1$frontpath2
routerswitchcrea="/switch.sty"
routerswitch=$specsPath1$routerswitchcrea
# routerswitchcrea="/switch.sty"
# routerswitch=$specsPath1$routerswitchcrea
# echo $specsPath;
touch $texfile;
if [ -e $routerfile ]
then
rm $routerfile ;
fi
#rm $routerfile;
touch $routerfile;
# # Router
# router1="\\\newcommand{\\\routername}{"
# router2="$routers"
# router3="}"
# routername=$router1$router2$router3
# echo $routername >> $routerfile;
# cp $routerfile $routerswitch;
cat Anleitung.tex >> $texfile;
if [ -e "specs.tex" ]
then
rm -f specs.tex ;
fi
if [ -e "front.pdf" ]
then
rm -f front.pdf ;
fi
if [ -e "back.pdf" ]
then
rm -f back.pdf;
fi
if [ -e "switch.sty" ]
then
rm -f switch.sty ;
fi
if [ -e $specsPath ]
then
cp $specsPath specs.tex ;
fi
if [ -e $frontpath ]
then
cp $frontpath front.pdf ;
fi
if [ -e $backpath ]
then
cp $backpath back.pdf ;
fi
if [ -e $routerswitch ]
then
cp $routerswitch switch.sty ;
fi
is=`expr $is + 1`
echo $is;
proz=$(bc -l <<< 'scale=2; '$should'/'$is'')
#let progress=100/$proz
echo "> "$(bc -l <<< 'scale=2; 100/'$proz'') "% done";
#echo "$texfile";
echo " $routers ";
sh latexdockercmd.sh arara $texfile
sh latexdockercmd.sh arara $texfile
# cleanup
rm $texfile ;
done;