Skip to content

Commit 137057c

Browse files
committed
fix error
1 parent 00d4f69 commit 137057c

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

Install/customize_firmware.sh

+19-20
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/bin/sh
22
clear
33
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 '=')
66
revision=${revision::-1}
77
release=${release::-1}
88
revision=${revision:1}
99
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 '=')
1313
architecture=${architecture::-1}
1414
target=${target::-1}
1515
architecture=${architecture:1}
@@ -22,8 +22,8 @@ check_hash() {
2222
}
2323

2424
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" ]
2727

2828
then
2929
customize_firmware_sub
@@ -119,7 +119,6 @@ DEVICE_MANUFACTURER='@CyberAndi'
119119
DEVICE_MANUFACTURER_URL='https://cyberandi.tumblr.com/'
120120
DEVICE_PRODUCT='CyberSecurity-Box'
121121
DEVICE_REVISION='v0.95'
122-
123122
EOF
124123

125124
cat << EOF > /etc/sysupgrade.conf
@@ -137,8 +136,8 @@ EOF
137136
datum=$(date +"%y%d%m%H%M")
138137
echo $datum
139138
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" ]
142141
then
143142
if [ "$(ls /www/luci-static/bootstrap/c*.css)" != "" ]
144143
then
@@ -151,10 +150,10 @@ if [ ! -f "$FILE" ]
151150
processes=$(rm /www/luci-static/resources/view/dashboard/css/c*.css)
152151
wait $processes
153152
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
156155
processes2=$(wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/index.php -P /www/)
157-
wait $processes2
156+
wait $processes2
158157
processes3=$(wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/output.php -P /www/)
159158
wait $processes3
160159
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" ]
172171

173172
fi
174173

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" ]
177176
then
178177
mv /www/luci-static/resources/view/status/include/*_dsl.js /www/luci-static/resources/view/status/include/10_dsl.js
179178
mv /www/luci-static/resources/view/status/include/*_ports.js /www/luci-static/resources/view/status/include/11_ports.js
@@ -194,7 +193,7 @@ echo
194193
}
195194

196195
create_hotspot(){
197-
FILE=/www/CaptivePortal/pic
196+
FILE4=/www/CaptivePortal/pic
198197
uci set wireless.radio0=wifi-device
199198
uci set wireless.radio0.type='mac80211'
200199
uci set wireless.radio0.path='platform/soc/a000000.wifi'
@@ -205,7 +204,7 @@ create_hotspot(){
205204
uci delete wireless.radio0.disabled >> install.log
206205
processes=$(uci commit && reload_config)
207206
wait $processes >> install.log
208-
if [ ! -d "$FILE" ]
207+
if [ ! -d "$FILE4" ]
209208
then
210209
create_hotspot_sub
211210
fi
@@ -222,8 +221,8 @@ mkdir -p /www/CaptivePortal
222221
mkdir -p /www/generate_204
223222
mkdir -p /www/CaptivePortal/pic
224223

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
227226
processes1=$(wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/CaptivePortal/captiveportal.htm -O /www/CaptivePortal/index.htm)
228227
wait $processes1
229228
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
349348
wget --waitretry=10 -t 5 -O /root/openWRT23_install.sh https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/Install/openWRT23_install.sh
350349
wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/index.php -P /www/
351350
wget https://github.com/CyberAndi/CyberSecurity-Box/raw/CyberSecurity-Box/www/output.php -P /www/
352-
wait $process
351+
wait
353352
else
354353
rm /root/*.sh
355354
fi

0 commit comments

Comments
 (0)