1
1
#! /bin/sh
2
2
clear
3
- release=$( cat /etc/openwrt_release | grep " DISTRIB_RELEASE" | cut -f2 -d ' =' )
4
- revision=$( cat /etc/openwrt_release | grep " DISTRIB_REVISION" | cut -f2 -d ' =' )
3
+ mv /www/index.html /www/index.old
4
+ release=$( grep " DISTRIB_RELEASE" /etc/openwrt_release | cut -f2 -d ' =' )
5
+ revision=$( grep " DISTRIB_REVISION" /etc/openwrt_release | cut -f2 -d ' =' )
5
6
revision=${revision::- 1}
6
7
release=${release::- 1}
7
8
revision=${revision: 1}
8
9
release=${release: 1}
9
- main_release=$( cat /etc/openwrt_release | grep " DISTRIB_RELEASE" | cut -f2 -d ' =' | cut -f1 -d ' .' | cut -c 2-)
10
- architecture=$( cat /etc/openwrt_release | grep " ARCH" | cut -f2 -d ' =' )
11
- target=$( cat /etc/openwrt_release | grep " TARGET" | cut -f2 -d ' =' )
10
+ main_release=$( grep " DISTRIB_RELEASE" /etc/openwrt_release | cut -f2 -d ' =' | cut -f1 -d ' .' | cut -c 2-)
11
+ architecture=$( grep " ARCH" /etc/openwrt_release | cut -f2 -d ' =' )
12
+ target=$( grep " TARGET" /etc/openwrt_release | cut -f2 -d ' =' )
12
13
architecture=${architecture::- 1}
13
14
target=${target::- 1}
14
15
architecture=${architecture: 1}
15
16
target=${target: 1}
16
17
18
+
17
19
LOCALADDRESS=" 127.192.0.1/10"
18
20
19
21
actLoop=$( ifconfig | grep ' ^l\w*' -m 1 | cut -f1 -d ' ' )
@@ -29,7 +31,7 @@ if [ ! -z "$1" ]
29
31
fi
30
32
INET_GW_org=$INET_GW
31
33
echo
32
- read -p ' Please give me the WAN-IP (Gateway/Router): [' $INET_GW ' ] ' INET_GW
34
+ # read -p 'Please give me the WAN-IP (Gateway/Router): ['$INET_GW'] ' INET_GW
33
35
echo
34
36
if [ " $INET_GW " = " " ]
35
37
then
90
92
91
93
LAN_org=$LAN
92
94
93
- read -p ' Type the LAN-IP (Internal Network): [' $( echo $LAN ) ' ] ' LAN
95
+ # read -p 'Type the LAN-IP (Internal Network): ['$( echo $LAN )'] ' LAN
94
96
if [ " $LAN " = " " ]
95
97
then
96
98
LAN=$LAN_org
97
99
fi
98
100
101
+
99
102
check_hash () {
100
103
local file=$1
101
104
echo " $EXPECTED_HASH $file " | sha256sum -c
102
105
}
103
106
104
- check_download () {
105
- local URL=$1
106
- local EXPECTED_HASH=$2
107
- local OUTPUT_FILE=$3
108
-
109
- wget --waitretry=10 -t 5 -O " /root/$OUTPUT_FILE " " $URL "
110
-
111
- if [[ $? -eq 0 ]]; then
112
- if check_hash " $OUTPUT_FILE " ; then
113
- echo " Hash is okay"
114
- break
115
- else
116
- # echo "Hash-Error"
117
- rm -f " $OUTPUT_FILE "
118
- fi
119
- fi
120
-
121
- }
122
-
123
107
customize_firmware () {
124
- FILE =/www/luci-static/resources/view/dashboard/css/c* .css
125
- if [ ! -f " $FILE " ]
108
+ FILE1 =/www/luci-static/resources/view/dashboard/css/c* .css
109
+ if [ ! -f " $FILE1 " ]
126
110
127
111
then
128
112
customize_firmware_sub
@@ -166,7 +150,6 @@ uci set luci.diag.route='brave.com'
166
150
uci set luci.diag.dns=' bible4u2lvhacg4b3to2e2veqpwmrc2c3tjf2wuuqiz332vlwmr4xbad.onion'
167
151
uci set network.wan6.disabled=' 1'
168
152
uci set wireless.default_radio0.ssid=' CyberSec-Box'
169
- uci set wireless.default_radio1.ssid=' CyberSec-Box'
170
153
uci set uhttpd.main.index_page=' index.php'
171
154
uci set uhttpd.main.interpreter=' .php=/usr/bin/php-cgi'
172
155
processes=$( uci commit && reload_config)
@@ -219,7 +202,6 @@ DEVICE_MANUFACTURER='@CyberAndi'
219
202
DEVICE_MANUFACTURER_URL='https://cyberandi.tumblr.com/'
220
203
DEVICE_PRODUCT='CyberSecurity-Box'
221
204
DEVICE_REVISION='v0.95'
222
-
223
205
EOF
224
206
225
207
cat << EOF > /etc/sysupgrade.conf
236
218
237
219
datum=$( date +" %y%d%m%H%M" )
238
220
echo $datum
239
- sleep 30
240
- FILE =/www/luci-static/bootstrap/OCR-A.ttf
241
- if [ ! -f " $FILE " ]
221
+ sleep 20
222
+ FILE2 =/www/luci-static/bootstrap/OCR-A.ttf
223
+ if [ ! -f " $FILE2 " ]
242
224
then
243
225
if [ " $( ls /www/luci-static/bootstrap/c* .css) " != " " ]
244
226
then
@@ -251,43 +233,29 @@ if [ ! -f "$FILE" ]
251
233
processes=$( rm /www/luci-static/resources/view/dashboard/css/c* .css)
252
234
wait $processes
253
235
fi
254
- # process=$(wget --waitretry=10 -t 5 -O /root/openWRT23_install.sh https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/Install/openWRT23_install.sh)
255
- # wait $process
236
+ process0=$( wget --waitretry=10 -t 5 -O /root/openWRT23_install.sh https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/Install/openWRT23_install.sh)
237
+ wait $process0
238
+ processes2=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/index.php -P /www/)
239
+ wait $processes2
240
+ processes3=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/output.php -P /www/)
241
+ wait $processes3
242
+ processes4=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/luci-static/bootstrap/CyberSecurity-Box.png -P /www/luci-static/bootstrap/)
243
+ wait $processes4
244
+ processes5=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/luci-static/bootstrap/CyberSecurity-Box.svg -P /www/luci-static/bootstrap/)
245
+ wait $processes5
246
+ processes6=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/luci-static/bootstrap/CyberAndi.svg -P /www/luci-static/bootstrap/)
247
+ wait $processes6
248
+ processes7=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/luci-static/bootstrap/cascade.css -P /www/luci-static/bootstrap/)
249
+ wait $processes7
250
+ processes8=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/luci-static/bootstrap/OCR-A.ttf -P /www/luci-static/bootstrap/)
251
+ wait $processes8
252
+ processes9=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/luci-static/bootstrap/OCR-A.woff -P /www/luci-static/bootstrap/)
253
+ wait $processes9
256
254
257
- if [ " $( ls /www/luci-static/bootstrap/logo.svg) " != " " ]
258
- then
259
- processes=$( rm /www/luci-static/bootstrap/logo* .* )
260
- wait $processes
261
- fi
262
-
263
- process=$( check_download " https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/Install/openWRT23_install.sh" " f9a60bb40fe8cc535e3d1a321b52cb2c76eaa80ffbf4884e43eeb0f7b910a2d2" " openWRT23_install.sh" )
264
- wait $process
265
- process1=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/logo.svg -P /www/)
266
- wait $process1
267
- process2=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/index.php -P /www/)
268
- wait $process2
269
- process3=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/output.php -P /www/)
270
- wait $process3
271
- process4=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/luci-static/bootstrap/CyberSecurity-Box.png -P /www/luci-static/bootstrap/)
272
- wait $process4
273
- process5=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/luci-static/bootstrap/CyberSecurity-Box.svg -P /www/luci-static/bootstrap/)
274
- wait $process5
275
- process6=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/luci-static/bootstrap/CyberAndi.svg -P /www/luci-static/bootstrap/)
276
- wait $process6
277
- process7=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/luci-static/bootstrap/cascade.css -P /www/luci-static/bootstrap/)
278
- wait $process7
279
- process8=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/luci-static/bootstrap/OCR-A.ttf -P /www/luci-static/bootstrap/)
280
- wait $process8
281
- process9=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/luci-static/bootstrap/OCR-A.woff -P /www/luci-static/bootstrap/)
282
- wait $process9
283
- process10=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/luci-static/bootstrap/logo.svg -P /www/luci-static/bootstrap/)
284
- wait $process10
285
- process11=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/luci-static/bootstrap/logo_48.png -P /www/luci-static/bootstrap/)
286
- wait $process11
287
255
fi
288
256
289
- FILE1 =/www/luci-static/resources/view/dashboard/css/c* .css
290
- if [ ! -f " $FILE " ]
257
+ FILE3 =/www/luci-static/resources/view/dashboard/css/c* .css
258
+ if [ ! -f " $FILE3 " ]
291
259
then
292
260
mv /www/luci-static/resources/view/status/include/* _dsl.js /www/luci-static/resources/view/status/include/10_dsl.js
293
261
mv /www/luci-static/resources/view/status/include/* _ports.js /www/luci-static/resources/view/status/include/11_ports.js
@@ -308,18 +276,18 @@ echo
308
276
}
309
277
310
278
create_hotspot (){
311
- FILE =/www/CaptivePortal/pic
312
- uci set wireless.radio0=wifi-device
279
+ FILE4 =/www/CaptivePortal/pic
280
+ uci set wireless.radio0=wifi-device
313
281
uci set wireless.radio0.type=' mac80211'
314
282
uci set wireless.radio0.path=' platform/soc/a000000.wifi'
315
283
uci set wireless.radio0.htmode=' HT20'
316
284
uci set wireless.radio0.country=' DE'
317
285
uci set wireless.radio0.channel=' auto'
318
286
uci set wireless.radio0.hwmode=' 11n'
319
- uci delete wireless.radio0.disabled >> install.log
320
- processes=$( uci commit && reload_config)
287
+ uci delete wireless.radio0.disabled >> install.log
288
+ processes=$( uci commit && reload_config)
321
289
wait $processes >> install.log
322
- if [ ! -d " $FILE " ]
290
+ if [ ! -d " $FILE4 " ]
323
291
then
324
292
create_hotspot_sub
325
293
fi
@@ -336,8 +304,8 @@ mkdir -p /www/CaptivePortal
336
304
mkdir -p /www/generate_204
337
305
mkdir -p /www/CaptivePortal/pic
338
306
339
- processe =$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/CaptivePortal/index.htm -P /www/)
340
- wait $processe
307
+ processes0 =$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/CaptivePortal/index.htm -P /www/)
308
+ wait $processes0
341
309
processes1=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/CaptivePortal/captiveportal.htm -O /www/CaptivePortal/index.htm)
342
310
wait $processes1
343
311
processes2=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/CaptivePortal/mobile.css -P /www/CaptivePortal/)
@@ -347,8 +315,8 @@ wait $processes3
347
315
processes4=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/CaptivePortal/theme_variable.css -P /www/CaptivePortal/)
348
316
wait $processes4
349
317
processes5=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/CaptivePortal/prophetie.htm -P /www/CaptivePortal/)
350
- wait $processes5
351
- processes6=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/CaptivePortal/OCR-A.ttf -P /www/CaptivePortal/)
318
+ # wait $processes5
319
+ # processes6=$(wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/CaptivePortal/OCR-A.ttf -P /www/CaptivePortal/)
352
320
wait $processes6
353
321
processes7=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/CaptivePortal/OCRAStd.woff -P /www/CaptivePortal/)
354
322
wait $processes7
@@ -456,25 +424,21 @@ echo $(date +%d'.'%m'.'%y' '%H':'%M':'%S)' Set uhttpd' >> install.log
456
424
set_uhttpd >> install.log
457
425
458
426
cat << EOF > /etc/rc.local
459
- if [ ! -f /root/openWRT23_install.sh ] && [ ! -f www/luci-static/bootstrap/cascade.css ]
427
+ if [ ! -f /root/openWRT23_install.sh ]
460
428
then
461
429
rm /www/index.html && sleep 20
462
- if [ ! -f /root/customize_firmware.sh ]
463
- then
464
- wget --waitretry=10 -t 5 -O /root/customize_firmware.sh https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/Install/customize_firmware.sh && sh /root/customize_firmware.sh & wait
465
- fi
430
+ # wget --waitretry=10 -t 5 -O /root/customize_firmware.sh https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/Install/customize_firmware.sh && sh /root/customize_firmware.sh & wait
466
431
wget --waitretry=10 -t 5 -O /root/openWRT23_install.sh https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/Install/openWRT23_install.sh
467
432
wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/index.php -P /www/
468
433
wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/output.php -P /www/
434
+ wait
469
435
else
470
436
rm /root/*.sh
471
- rm /root/*.sh.*
472
437
fi
473
438
if [ ! -f /root/run ]
474
439
then
475
- echo $( date) > /root/run
476
- rm /root/customize_firmware.sh
477
- exit 0
440
+ echo "'"$( date) "'" > /root/run
441
+ exit 0
478
442
fi
479
443
rm /etc/rc.local
480
444
echo "" > /www/phpinfo.php
0 commit comments