@@ -8,43 +8,43 @@ cpu_type="$(uname -m)"
8
8
# 3rd arg : raw or normal. Raw is used to download specific file from specific dir
9
9
# 4th arg : addtional command to append to setup.sh (usefull if setup.sh contains also uninstall command)
10
10
install_from_github () {
11
- mkdir /tmp/$2
11
+ mkdir " /tmp/$2 "
12
12
13
- if [ $3 = = " specificapp" ]; then
14
- if [ ! -f /tmp/$2 .tar.bz2 ]; then
13
+ if [ " $3 " = " specificapp" ]; then
14
+ if [ ! -f " /tmp/$2 .tar.bz2" ]; then
15
15
if ! ping -q -c 1 -W 1 8.8.8.8 > /dev/null 2>&1 ; then
16
16
echo " No internet connection detected, download manually!"
17
17
exit 0
18
18
fi
19
- curl -sLk https://raw.githubusercontent.com/$1 /$2 .tar.bz2 --output /tmp/$2 .tar.bz2
19
+ curl -sLk " https://raw.githubusercontent.com/$1 /$2 .tar.bz2" --output " /tmp/$2 .tar.bz2"
20
20
fi
21
- if [ ! -f /tmp/$2 .tar.bz2 ]; then
21
+ if [ ! -f " /tmp/$2 .tar.bz2" ]; then
22
22
echo " Error installing App: Cannot find/download $2 .tar.bz2"
23
23
return 1
24
24
fi
25
- bzcat /tmp/$2 .tar.bz2 | tar -C /tmp/$2 -xf -
26
- rm /tmp/$2 .tar.bz2
27
- cd /tmp/$2
25
+ bzcat " /tmp/$2 .tar.bz2" | tar -C " /tmp/$2 " -xf -
26
+ rm " /tmp/$2 .tar.bz2"
27
+ cd " /tmp/$2 " || return 1
28
28
else
29
- if [ ! -f /tmp/$2 .tar.gz ]; then
29
+ if [ ! -f " /tmp/$2 .tar.gz" ]; then
30
30
if ! ping -q -c 1 -W 1 8.8.8.8 > /dev/null 2>&1 ; then
31
31
echo " No internet connection detected, download manually!"
32
32
exit 0
33
33
fi
34
- curl -sLk https://github.com/$1 /tarball/$2 --output /tmp/$2 .tar.gz
34
+ curl -sLk " https://github.com/$1 /tarball/$2 " --output " /tmp/$2 .tar.gz"
35
35
fi
36
- if [ ! -f /tmp/$2 .tar.gz ]; then
36
+ if [ ! -f " /tmp/$2 .tar.gz" ]; then
37
37
echo " Error installing App: Cannot find/download $2 .tar.gz"
38
38
return 1
39
39
fi
40
- tar -xzf /tmp/$2 .tar.gz -C /tmp/$2
41
- rm /tmp/$2 .tar.gz
42
- cd /tmp/$2 /*
40
+ tar -xzf " /tmp/$2 .tar.gz" -C " /tmp/$2 "
41
+ rm " /tmp/$2 .tar.gz"
42
+ cd " /tmp/$2 /*"
43
43
fi
44
44
45
45
chmod +x ./setup.sh
46
46
./setup.sh " $4 "
47
- rm -rf /tmp/$2
47
+ rm -rf " /tmp/$2 "
48
48
}
49
49
50
50
# ###########TRANSFORMER UTILITY##################
@@ -74,12 +74,12 @@ app_transmission() {
74
74
install () {
75
75
case $marketing_version in
76
76
" 16.1" * | " 16.2" * )
77
- [ " $cpu_type " == " armv7l" ] && install_from_github FrancYescO/sharing_tg789 transmission-xtream
78
- [ " $cpu_type " == " mips" ] && install_from_github FrancYescO/sharing_tg789 transmission
77
+ [ " $cpu_type " = " armv7l" ] && install_from_github FrancYescO/sharing_tg789 transmission-xtream
78
+ [ " $cpu_type " = " mips" ] && install_from_github FrancYescO/sharing_tg789 transmission
79
79
;;
80
80
" 16." * | " 17." * | " 18." * )
81
- [ " $cpu_type " == " armv7l" ] && install_arm
82
- [ " $cpu_type " == " mips" ] && install_from_github FrancYescO/sharing_tg789 transmission
81
+ [ " $cpu_type " = " armv7l" ] && install_arm
82
+ [ " $cpu_type " = " mips" ] && install_from_github FrancYescO/sharing_tg789 transmission
83
83
;;
84
84
* )
85
85
echo " Unknown app install script for $marketing_version $cpu_type "
@@ -106,7 +106,7 @@ app_transmission() {
106
106
107
107
case $1 in
108
108
install)
109
- install $2
109
+ install " $2 "
110
110
;;
111
111
remove)
112
112
remove
@@ -152,7 +152,7 @@ app_telstra() {
152
152
153
153
case $1 in
154
154
install)
155
- install $2
155
+ install " $2 "
156
156
;;
157
157
remove)
158
158
remove
@@ -181,7 +181,7 @@ app_luci() {
181
181
mv /usr/lib/lua/uci.so_bak /usr/lib/lua/uci.so
182
182
sed -i ' s/require "uci"/require "uci_luci"/g' /usr/lib/lua/luci/model/uci.lua # modify luci to load his original lib with different name
183
183
184
- if [ ! $( uci get uhttpd.main.listen_http | grep 9080) ]; then
184
+ if [ ! " $( uci get uhttpd.main.listen_http | grep 9080) " ]; then
185
185
uci del_list uhttpd.main.listen_http=' 0.0.0.0:80'
186
186
uci add_list uhttpd.main.listen_http=' 0.0.0.0:9080'
187
187
uci del_list uhttpd.main.listen_http=' [::]:80'
@@ -205,20 +205,20 @@ app_luci() {
205
205
206
206
case $marketing_version in
207
207
" 16.1" * | " 16.2" * )
208
- [ " $cpu_type " == " armv7l" ] && echo " Unknown app install script for $marketing_version $cpu_type "
209
- [ " $cpu_type " == " mips" ] && luci_install_mips
208
+ [ " $cpu_type " = " armv7l" ] && echo " Unknown app install script for $marketing_version $cpu_type "
209
+ [ " $cpu_type " = " mips" ] && luci_install_mips
210
210
;;
211
211
" 16." * | " 17." * )
212
- [ " $cpu_type " == " armv7l" ] && {
212
+ [ " $cpu_type " = " armv7l" ] && {
213
213
luci_install_arm
214
214
opkg install --force-reinstall --force-overwrite libuci-lua
215
215
sed -i ' s/require "uci_luci"/require "uci"/g' /usr/lib/lua/luci/model/uci.lua
216
216
}
217
- [ " $cpu_type " == " mips" ] && luci_install_mips
217
+ [ " $cpu_type " = " mips" ] && luci_install_mips
218
218
;;
219
219
" 18." * )
220
- [ " $cpu_type " == " armv7l" ] && luci_install_arm
221
- [ " $cpu_type " == " mips" ] && luci_install_mips
220
+ [ " $cpu_type " = " armv7l" ] && luci_install_arm
221
+ [ " $cpu_type " = " mips" ] && luci_install_mips
222
222
;;
223
223
* )
224
224
echo " Unknown app install script for $marketing_version $cpu_type "
@@ -243,15 +243,15 @@ app_luci() {
243
243
/tmp/uninstall.sh
244
244
}
245
245
246
- [ " $cpu_type " == " armv7l" ] && luci_remove_arm
247
- [ " $cpu_type " == " mips" ] && luci_remove_mips
246
+ [ " $cpu_type " = " armv7l" ] && luci_remove_arm
247
+ [ " $cpu_type " = " mips" ] && luci_remove_mips
248
248
uci set modgui.app.luci_webui=" 0"
249
249
uci commit modgui
250
250
}
251
251
252
252
case $1 in
253
253
install)
254
- install $2
254
+ install " $2 "
255
255
;;
256
256
remove)
257
257
remove
@@ -265,8 +265,8 @@ app_luci() {
265
265
266
266
app_amule () {
267
267
install () {
268
- [ " $cpu_type " == " armv7l" ] && echo " Unknown app install script for $marketing_version $cpu_type "
269
- [ " $cpu_type " == " mips" ] && install_from_github FrancYescO/sharing_tg789 amule
268
+ [ " $cpu_type " = " armv7l" ] && echo " Unknown app install script for $marketing_version $cpu_type "
269
+ [ " $cpu_type " = " mips" ] && install_from_github FrancYescO/sharing_tg789 amule
270
270
uci set modgui.app.amule_webui=" 1"
271
271
uci commit modgui
272
272
}
@@ -285,7 +285,7 @@ app_amule() {
285
285
286
286
case $1 in
287
287
install)
288
- install $2
288
+ install " $2 "
289
289
;;
290
290
start)
291
291
start
@@ -294,7 +294,7 @@ app_amule() {
294
294
stop
295
295
;;
296
296
* )
297
- echo " Unsupported action "
297
+ remove
298
298
return 1
299
299
;;
300
300
esac
@@ -315,15 +315,16 @@ app_aria2() {
315
315
mkdir $ARIA2_DIR
316
316
touch $ARIA2_DIR /aria2.conf
317
317
touch $ARIA2_DIR /aria2.session
318
-
319
- echo ' enable-rpc=true' >> $ARIA2_DIR /aria2.conf
320
- echo ' rpc-allow-origin-all=true' >> $ARIA2_DIR /aria2.conf
321
- echo ' rpc-listen-all=true' >> $ARIA2_DIR /aria2.conf
322
- echo ' rpc-listen-port=6800' >> $ARIA2_DIR /aria2.conf
323
- echo ' input-file=/etc/aria2/aria2.session' >> $ARIA2_DIR /aria2.conf
324
- echo ' save-session=/etc/aria2/aria2.session' >> $ARIA2_DIR /aria2.conf
325
- echo ' save-session-interval=300' >> $ARIA2_DIR /aria2.conf
326
- echo ' dir=/mnt/usb/USB-A1' >> $ARIA2_DIR /aria2.conf
318
+ {
319
+ echo ' enable-rpc=true'
320
+ echo ' rpc-allow-origin-all=true'
321
+ echo ' rpc-listen-all=true'
322
+ echo ' rpc-listen-port=6800'
323
+ echo ' input-file=/etc/aria2/aria2.session'
324
+ echo ' save-session=/etc/aria2/aria2.session'
325
+ echo ' save-session-interval=300'
326
+ echo ' dir=/mnt/usb/USB-A1'
327
+ } >> $ARIA2_DIR /aria2.conf
327
328
328
329
# add aria2 in /etc/rc.local to start the daemon after a reboot
329
330
sed -i ' /exit 0/i \
@@ -335,12 +336,12 @@ app_aria2() {
335
336
336
337
case $marketing_version in
337
338
" 16.1" * | " 16.2" * )
338
- [ " $cpu_type " == " armv7l" ] && install_from_github FrancYescO/sharing_tg789 aria2-xtream
339
- [ " $cpu_type " == " mips" ] && install_from_github FrancYescO/sharing_tg789 aria2
339
+ [ " $cpu_type " = " armv7l" ] && install_from_github FrancYescO/sharing_tg789 aria2-xtream
340
+ [ " $cpu_type " = " mips" ] && install_from_github FrancYescO/sharing_tg789 aria2
340
341
;;
341
342
" 16." * | " 17." * | " 18." * )
342
- [ " $cpu_type " == " armv7l" ] && install_arm
343
- [ " $cpu_type " == " mips" ] && install_from_github FrancYescO/sharing_tg789 aria2
343
+ [ " $cpu_type " = " armv7l" ] && install_arm
344
+ [ " $cpu_type " = " mips" ] && install_from_github FrancYescO/sharing_tg789 aria2
344
345
;;
345
346
* )
346
347
echo " Unknown app install script for $marketing_version $cpu_type "
@@ -367,7 +368,7 @@ app_aria2() {
367
368
368
369
case $1 in
369
370
install)
370
- install $2
371
+ install " $2 "
371
372
;;
372
373
remove)
373
374
remove
@@ -387,7 +388,7 @@ app_aria2() {
387
388
388
389
app_blacklist () {
389
390
install () {
390
- install_from_github Ansuel/blacklist master normal $2
391
+ install_from_github Ansuel/blacklist master normal " $2 "
391
392
uci set modgui.app.blacklist_app=" 1"
392
393
uci commit modgui
393
394
}
@@ -402,7 +403,7 @@ app_blacklist() {
402
403
403
404
case $1 in
404
405
install)
405
- install $2
406
+ install " $2 "
406
407
;;
407
408
remove)
408
409
remove
@@ -447,7 +448,7 @@ app_xupnp() {
447
448
install_specific_files () {
448
449
449
450
install () {
450
- install_from_github Ansuel/gui-dev-build-auto/master/modular upgrade-pack-specific$1 specificapp
451
+ install_from_github Ansuel/gui-dev-build-auto/master/modular " upgrade-pack-specific$1 " specificapp
451
452
uci set modgui.app.specific_app=1
452
453
uci commit
453
454
}
@@ -458,7 +459,7 @@ install_specific_files() {
458
459
459
460
case $1 in
460
461
install)
461
- install $2
462
+ install " $2 "
462
463
;;
463
464
remove)
464
465
remove
@@ -473,28 +474,28 @@ install_specific_files() {
473
474
call_app_type () {
474
475
case " $2 " in
475
476
transmission)
476
- app_transmission $1
477
+ app_transmission " $1 "
477
478
;;
478
479
telstra)
479
- app_telstra $1
480
+ app_telstra " $1 "
480
481
;;
481
482
luci)
482
- app_luci $1
483
+ app_luci " $1 "
483
484
;;
484
485
amule)
485
- app_amule $1
486
+ app_amule " $1 "
486
487
;;
487
488
aria2)
488
- app_aria2 $1
489
+ app_aria2 " $1 "
489
490
;;
490
491
xupnp)
491
- app_xupnp $1
492
+ app_xupnp " $1 "
492
493
;;
493
494
blacklist)
494
- app_blacklist $1 $3
495
+ app_blacklist " $1 " " $3 "
495
496
;;
496
497
specificapp)
497
- install_specific_files $1 $3
498
+ install_specific_files " $1 " " $3 "
498
499
;;
499
500
* )
500
501
echo " Provide a valid APP_NAME" 1>&2
0 commit comments