1
1
#! /bin/sh
2
2
clear
3
3
mv /www/index.html /www/index.old
4
- release=$( cat /etc/openwrt_release | grep " DISTRIB_RELEASE" | cut -f2 -d ' =' )
5
- revision=$( cat /etc/openwrt_release | grep " DISTRIB_REVISION" | cut -f2 -d ' =' )
4
+ release=$( grep " DISTRIB_RELEASE" /etc/openwrt_release | cut -f2 -d ' =' )
5
+ revision=$( grep " DISTRIB_REVISION" /etc/openwrt_release | cut -f2 -d ' =' )
6
6
revision=${revision::- 1}
7
7
release=${release::- 1}
8
8
revision=${revision: 1}
9
9
release=${release: 1}
10
- main_release=$( cat /etc/openwrt_release | grep " DISTRIB_RELEASE" | cut -f2 -d ' =' | cut -f1 -d ' .' | cut -c 2-)
11
- architecture=$( cat /etc/openwrt_release | grep " ARCH" | cut -f2 -d ' =' )
12
- 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 ' =' )
13
13
architecture=${architecture::- 1}
14
14
target=${target::- 1}
15
15
architecture=${architecture: 1}
@@ -22,8 +22,8 @@ check_hash() {
22
22
}
23
23
24
24
customize_firmware () {
25
- FILE =/www/luci-static/resources/view/dashboard/css/c* .css
26
- if [ ! -f " $FILE " ]
25
+ FILE1 =/www/luci-static/resources/view/dashboard/css/c* .css
26
+ if [ ! -f " $FILE1 " ]
27
27
28
28
then
29
29
customize_firmware_sub
@@ -119,7 +119,6 @@ DEVICE_MANUFACTURER='@CyberAndi'
119
119
DEVICE_MANUFACTURER_URL='https://cyberandi.tumblr.com/'
120
120
DEVICE_PRODUCT='CyberSecurity-Box'
121
121
DEVICE_REVISION='v0.95'
122
-
123
122
EOF
124
123
125
124
cat << EOF > /etc/sysupgrade.conf
137
136
datum=$( date +" %y%d%m%H%M" )
138
137
echo $datum
139
138
sleep 20
140
- FILE =/www/luci-static/bootstrap/OCR-A.ttf
141
- if [ ! -f " $FILE " ]
139
+ FILE2 =/www/luci-static/bootstrap/OCR-A.ttf
140
+ if [ ! -f " $FILE2 " ]
142
141
then
143
142
if [ " $( ls /www/luci-static/bootstrap/c* .css) " != " " ]
144
143
then
@@ -151,10 +150,10 @@ if [ ! -f "$FILE" ]
151
150
processes=$( rm /www/luci-static/resources/view/dashboard/css/c* .css)
152
151
wait $processes
153
152
fi
154
- process =$( wget --waitretry=10 -t 5 -O /root/openWRT23_install.sh https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/Install/openWRT23_install.sh)
155
- wait $process
153
+ process0 =$( wget --waitretry=10 -t 5 -O /root/openWRT23_install.sh https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/Install/openWRT23_install.sh)
154
+ wait $process0
156
155
processes2=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/index.php -P /www/)
157
- wait $processes2
156
+ wait $processes2
158
157
processes3=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/output.php -P /www/)
159
158
wait $processes3
160
159
processes4=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/luci-static/bootstrap/CyberSecurity-Box.png -P /www/luci-static/bootstrap/)
@@ -172,8 +171,8 @@ if [ ! -f "$FILE" ]
172
171
173
172
fi
174
173
175
- FILE1 =/www/luci-static/resources/view/dashboard/css/c* .css
176
- if [ ! -f " $FILE " ]
174
+ FILE3 =/www/luci-static/resources/view/dashboard/css/c* .css
175
+ if [ ! -f " $FILE3 " ]
177
176
then
178
177
mv /www/luci-static/resources/view/status/include/* _dsl.js /www/luci-static/resources/view/status/include/10_dsl.js
179
178
mv /www/luci-static/resources/view/status/include/* _ports.js /www/luci-static/resources/view/status/include/11_ports.js
194
193
}
195
194
196
195
create_hotspot (){
197
- FILE =/www/CaptivePortal/pic
196
+ FILE4 =/www/CaptivePortal/pic
198
197
uci set wireless.radio0=wifi-device
199
198
uci set wireless.radio0.type=' mac80211'
200
199
uci set wireless.radio0.path=' platform/soc/a000000.wifi'
@@ -205,7 +204,7 @@ create_hotspot(){
205
204
uci delete wireless.radio0.disabled >> install.log
206
205
processes=$( uci commit && reload_config)
207
206
wait $processes >> install.log
208
- if [ ! -d " $FILE " ]
207
+ if [ ! -d " $FILE4 " ]
209
208
then
210
209
create_hotspot_sub
211
210
fi
@@ -222,8 +221,8 @@ mkdir -p /www/CaptivePortal
222
221
mkdir -p /www/generate_204
223
222
mkdir -p /www/CaptivePortal/pic
224
223
225
- processe =$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/CaptivePortal/index.htm -P /www/)
226
- wait $processe
224
+ processes0 =$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/CaptivePortal/index.htm -P /www/)
225
+ wait $processes0
227
226
processes1=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/CaptivePortal/captiveportal.htm -O /www/CaptivePortal/index.htm)
228
227
wait $processes1
229
228
processes2=$( wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/CaptivePortal/mobile.css -P /www/CaptivePortal/)
@@ -349,7 +348,7 @@ cat << EOF > /etc/rc.local
349
348
wget --waitretry=10 -t 5 -O /root/openWRT23_install.sh https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/Install/openWRT23_install.sh
350
349
wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/index.php -P /www/
351
350
wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/output.php -P /www/
352
- wait $process
351
+ wait
353
352
else
354
353
rm /root/*.sh
355
354
fi
0 commit comments