浏览代码

Merge branch 'stretch' of https://github.com/bashrc/freedombone

Bob Mottram 7 年前
父节点
当前提交
4701bf16a9

+ 8
- 4
src/freedombone-addremove 查看文件

@@ -72,7 +72,8 @@ function mark_unselected_apps_as_removed {
72 72
     fi
73 73
 
74 74
     app_index=0
75
-    for app_name in "${APPS_AVAILABLE[@]}"
75
+    # shellcheck disable=SC2068
76
+    for app_name in ${APPS_AVAILABLE[@]}
76 77
     do
77 78
         if [[ ${APPS_CHOSEN[$app_index]} == "0" ]]; then
78 79
             echo "_${app_name}_" >> "$REMOVED_APPS_FILE"
@@ -106,7 +107,8 @@ function show_apps {
106 107
     applist=""
107 108
     n=1
108 109
     app_index=0
109
-    for a in "${APPS_AVAILABLE[@]}"
110
+    # shellcheck disable=SC2068
111
+    for a in ${APPS_AVAILABLE[@]}
110 112
     do
111 113
         if [[ ${APPS_INSTALLED[$app_index]} == "0" &&  "$select_all_apps" != "add-all" ]]; then
112 114
             applist="$applist $n $a off"
@@ -144,7 +146,8 @@ function remove_apps_selected {
144 146
     removals=""
145 147
     app_index=0
146 148
     n=0
147
-    for a in "${APPS_INSTALLED[@]}"
149
+    # shellcheck disable=SC2068
150
+    for a in ${APPS_INSTALLED[@]}
148 151
     do
149 152
         if [[ ${APPS_INSTALLED[$app_index]} == "1" ]]; then
150 153
             if [[ ${APPS_CHOSEN[$app_index]} == "0" ]]; then
@@ -188,7 +191,8 @@ function install_apps_selected {
188 191
     installs=""
189 192
     app_index=0
190 193
     n=0
191
-    for a in "${APPS_INSTALLED[@]}"
194
+    # shellcheck disable=SC2068
195
+    for a in ${APPS_INSTALLED[@]}
192 196
     do
193 197
         if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
194 198
             if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then

+ 2
- 1
src/freedombone-adduser 查看文件

@@ -211,7 +211,8 @@ chmod 600 "/home/$ADD_USERNAME/README"
211 211
 echo $'Detecting installed apps...'
212 212
 detect_apps
213 213
 get_apps_installed_names
214
-for app_name in "${APPS_INSTALLED_NAMES[@]}"
214
+# shellcheck disable=SC2068
215
+for app_name in ${APPS_INSTALLED_NAMES[@]}
215 216
 do
216 217
     if [[ $(function_exists "add_user_${app_name}") == "1" ]]; then
217 218
         echo $"Adding user to ${app_name}"

+ 2
- 1
src/freedombone-app-pelican 查看文件

@@ -295,7 +295,8 @@ function pelican_change_theme {
295 295
     if [ -f $PELICAN_BLOG_INSTALL_DIR/.blog-theme-index ]; then
296 296
         curr_theme_index=$(cat $PELICAN_BLOG_INSTALL_DIR/.blog-theme-index)
297 297
     fi
298
-    for a in "${THEMES[@]}"
298
+    # shellcheck disable=SC2068
299
+    for a in ${THEMES[@]}
299 300
     do
300 301
         is_selected='off'
301 302
         if [ "$curr_theme_index" ]; then

+ 15
- 7
src/freedombone-app-pleroma 查看文件

@@ -47,7 +47,7 @@ PLEROMA_CODE=
47 47
 PLEROMA_PORT=4000
48 48
 PLEROMA_ONION_PORT=8011
49 49
 PLEROMA_REPO="https://git.pleroma.social/pleroma/pleroma.git"
50
-PLEROMA_COMMIT='2f291576e4eef95e6867348e24bc526058518095'
50
+PLEROMA_COMMIT='460062f2b04220ffcd8f20aa842cc95582d1f849'
51 51
 PLEROMA_ADMIN_PASSWORD=
52 52
 PLEROMA_DIR=/etc/pleroma
53 53
 PLEROMA_SECRET_KEY=""
@@ -180,7 +180,7 @@ function expire_pleroma_posts {
180 180
       echo '';
181 181
       echo '# copy the avatar files to a temporary directory';
182 182
       echo "arr=( \$avatars )";
183
-      echo "for i in \"\${arr[@]}\"; do";
183
+      echo "for i in \${arr[@]}; do";
184 184
       echo "    if [[ \"\$i\" == *'/media/'* ]]; then";
185 185
       echo "        imagefile=/etc/pleroma/uploads/\$(echo \$i | sed 's|\"||g' | sed 's|,||g' | awk -F '/media/' '{print \$2}');";
186 186
       echo "        if [ -f \$imagefile ]; then";
@@ -203,7 +203,7 @@ function expire_pleroma_posts {
203 203
       echo '';
204 204
       echo '# copy the banner files to a temporary directory';
205 205
       echo "arr=( \$banners )";
206
-      echo "for i in \"\${arr[@]}\"; do";
206
+      echo "for i in \${arr[@]}; do";
207 207
       echo "    if [[ \"\$i\" == *'/media/'* ]]; then";
208 208
       echo "        imagefile=/etc/pleroma/uploads/\$(echo \$i | sed 's|\"||g' | sed 's|,||g' | awk -F '/media/' '{print \$2}');";
209 209
       echo "        if [ -f \$imagefile ]; then";
@@ -570,11 +570,15 @@ function pleroma_disable_registrations {
570 570
            --yesno $"\\nDo you wish to disable new registrations?" 10 60
571 571
     sel=$?
572 572
     case $sel in
573
-        0) sed -i 's|registrations_open:.*|registrations_open: false,|g' $PLEROMA_DIR/config/config.exs
574
-           sed -i 's|"registrationOpen":.*|"registrationOpen": false,|g' $PLEROMA_DIR/priv/static/static/config.json
573
+        0) sed -i 's|registrations_open: true|registrations_open: false|g' $PLEROMA_DIR/config/config.exs
574
+           sed -i 's|registrations_open: True|registrations_open: false|g' $PLEROMA_DIR/config/config.exs
575
+           sed -i 's|"registrationOpen": true|"registrationOpen": false|g' $PLEROMA_DIR/priv/static/static/config.json
576
+           sed -i 's|"registrationOpen": True|"registrationOpen": false|g' $PLEROMA_DIR/priv/static/static/config.json
575 577
            ;;
576
-        1) sed -i 's|registrations_open:.*|registrations_open: true,|g' $PLEROMA_DIR/config/config.exs
577
-           sed -i 's|"registrationOpen":.*|"registrationOpen": true,|g' $PLEROMA_DIR/priv/static/static/config.json
578
+        1) sed -i 's|registrations_open: false|registrations_open: true|g' $PLEROMA_DIR/config/config.exs
579
+           sed -i 's|registrations_open: False|registrations_open: true|g' $PLEROMA_DIR/config/config.exs
580
+           sed -i 's|"registrationOpen": false|"registrationOpen": true|g' $PLEROMA_DIR/priv/static/static/config.json
581
+           sed -i 's|"registrationOpen": False|"registrationOpen": true|g' $PLEROMA_DIR/priv/static/static/config.json
578 582
            ;;
579 583
         255) return;;
580 584
     esac
@@ -755,8 +759,12 @@ function upgrade_pleroma {
755 759
     fi
756 760
 
757 761
     sudo -u pleroma mix deps.get
762
+
758 763
     pleroma_recompile
759 764
 
765
+    # migrate database
766
+    sudo -u pleroma mix deps.clean --build mime
767
+
760 768
     expire_pleroma_posts "$PLEROMA_DOMAIN_NAME" "$PLEROMA_EXPIRE_MONTHS"
761 769
     create_pleroma_blocklist
762 770
 

+ 2
- 1
src/freedombone-backup-local 查看文件

@@ -228,7 +228,8 @@ function backup_directories {
228 228
         "/root/.passwords,                      passwordstore"
229 229
     )
230 230
 
231
-    for dr in "${backup_dirs[@]}"
231
+    # shellcheck disable=SC2068
232
+    for dr in ${backup_dirs[@]}
232 233
     do
233 234
         # if this directory exists then back it up to the given destination
234 235
         source_directory=$(echo "$dr" | awk -F ',' '{print $1}'  | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')

+ 4
- 2
src/freedombone-config 查看文件

@@ -798,7 +798,8 @@ function choose_system_variant {
798 798
 
799 799
     varslist=""
800 800
     n=1
801
-    for a in "${available_variants_list[@]}"
801
+    # shellcheck disable=SC2068
802
+    for a in ${available_variants_list[@]}
802 803
     do
803 804
         varstate='off'
804 805
         if [[ "$a" == $'full' || "$a" == $'Full' ]]; then
@@ -1057,7 +1058,8 @@ function select_user {
1057 1058
     users_array=($homedirs)
1058 1059
 
1059 1060
     delete=(git)
1060
-    for del in "${delete[@]}"
1061
+    # shellcheck disable=SC2068
1062
+    for del in ${delete[@]}
1061 1063
     do
1062 1064
         # shellcheck disable=SC2206
1063 1065
         users_array=(${users_array[@]/$del})

+ 10
- 5
src/freedombone-controlpanel 查看文件

@@ -230,7 +230,8 @@ function passwords_show_apps {
230 230
     i=0
231 231
     W=()
232 232
     name=()
233
-    for a in "${APPS_AVAILABLE[@]}"
233
+    # shellcheck disable=SC2068
234
+    for a in ${APPS_AVAILABLE[@]}
234 235
     do
235 236
         if [[ $(function_exists "change_password_${a}") == "1" ]]; then
236 237
             i=$((i+1))
@@ -410,7 +411,8 @@ function show_domains {
410 411
         grep 'sks onion domain' "${COMPLETION_FILE}" | awk -F ':' '{print $2}'
411 412
     fi
412 413
 
413
-    for app_name in "${APPS_INSTALLED_NAMES[@]}"
414
+    # shellcheck disable=SC2068
415
+    for app_name in ${APPS_INSTALLED_NAMES[@]}
414 416
     do
415 417
         if ! grep -q "SHOW_ON_ABOUT=1" "/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-${app_name}"; then
416 418
             continue
@@ -1129,7 +1131,8 @@ function restore_data_from_storage {
1129 1131
         app_list+=("$AllStr")
1130 1132
 
1131 1133
         util_index=0
1132
-        for a in "${utils_installed[@]}"
1134
+        # shellcheck disable=SC2068
1135
+        for a in ${utils_installed[@]}
1133 1136
         do
1134 1137
             applist="$applist $n $a off"
1135 1138
             app_name=${utils_installed[util_index]}
@@ -1139,7 +1142,8 @@ function restore_data_from_storage {
1139 1142
         done
1140 1143
 
1141 1144
         app_index=0
1142
-        for a in "${APPS_INSTALLED_NAMES[@]}"
1145
+        # shellcheck disable=SC2068
1146
+        for a in ${APPS_INSTALLED_NAMES[@]}
1143 1147
         do
1144 1148
             applist="$applist $n $a off"
1145 1149
             n=$((n+1))
@@ -2233,7 +2237,8 @@ function menu_app_settings {
2233 2237
     appnames=()
2234 2238
     n=1
2235 2239
     app_index=0
2236
-    for a in "${APPS_AVAILABLE[@]}"
2240
+    # shellcheck disable=SC2068
2241
+    for a in ${APPS_AVAILABLE[@]}
2237 2242
     do
2238 2243
         if [[ ${APPS_INSTALLED[$app_index]} != "0" ]]; then
2239 2244
             if [[ $(function_exists "configure_interactive_${a}") == "1" ]]; then

+ 2
- 1
src/freedombone-controlpanel-user 查看文件

@@ -837,7 +837,8 @@ function menu_run_client_app {
837 837
     appnames=()
838 838
     n=1
839 839
     app_index=0
840
-    for a in "${APPS_AVAILABLE[@]}"
840
+    # shellcheck disable=SC2068
841
+    for a in ${APPS_AVAILABLE[@]}
841 842
     do
842 843
         if [[ ${APPS_INSTALLED[$app_index]} != "0" ]]; then
843 844
             if [[ $(function_exists "run_client_${a}") == "1" ]]; then

+ 4
- 2
src/freedombone-freedns 查看文件

@@ -55,7 +55,8 @@ detected_codes=()
55 55
 codelines=$(grep "_CODE=" "$CONFIGURATION_FILE" | uniq)
56 56
 while read -r line; do
57 57
     code=$(echo "$line" | awk -F '=' '{print $2}')
58
-    if ! item_in_array "$code" "${detected_codes[@]}"; then
58
+    # shellcheck disable=SC2068
59
+    if ! item_in_array "$code" ${detected_codes[@]}; then
59 60
         detected_codes+=("$code")
60 61
     fi
61 62
 done <<< "$codelines"
@@ -64,7 +65,8 @@ if [ ! -d "$HOME/.freedns-update" ]; then
64 65
     mkdir "$HOME/.freedns-update"
65 66
 fi
66 67
 cd "$HOME/.freedns-update" || exit 2467824684
67
-for code in "${detected_codes[@]}"
68
+# shellcheck disable=SC2068
69
+for code in ${detected_codes[@]}
68 70
 do
69 71
     if [ $VERBOSE ]; then
70 72
         echo $"command: $FREEDNS_WGET${code}="

+ 6
- 3
src/freedombone-image 查看文件

@@ -482,7 +482,8 @@ fi
482 482
 
483 483
 # Move any existing images into a build subdirectory
484 484
 image_types=( xz img sig vdi qcow2 )
485
-for im in "${image_types[@]}"
485
+# shellcheck disable=SC2068
486
+for im in ${image_types[@]}
486 487
 do
487 488
     # shellcheck disable=SC2012,SC2086
488 489
     no_of_files=$(ls -afq ${CURR_DIR}/${PROJECT_NAME}*.${im} | wc -l)
@@ -496,7 +497,8 @@ do
496 497
 done
497 498
 
498 499
 # Delete anything which didn't move
499
-for im in "${image_types[@]}"
500
+# shellcheck disable=SC2068
501
+for im in ${image_types[@]}
500 502
 do
501 503
     # shellcheck disable=SC2012,SC2086
502 504
     no_of_files=$(ls -afq ${CURR_DIR}/${PROJECT_NAME}*.${im} | wc -l)
@@ -624,7 +626,8 @@ if [ ${#imgfiles[@]} -eq 0 ]; then
624 626
 fi
625 627
 
626 628
 # Move images from temporary directory to the current directory
627
-for im in "${image_types[@]}"
629
+# shellcheck disable=SC2068
630
+for im in ${image_types[@]}
628 631
 do
629 632
     # shellcheck disable=SC2012,SC2086
630 633
     no_of_files=$(ls -afq build/${PROJECT_NAME}*.${im} | wc -l)

+ 4
- 2
src/freedombone-logging 查看文件

@@ -73,7 +73,8 @@ function logging_get_app_names {
73 73
 function turn_logging_on {
74 74
     logging_get_app_names
75 75
 
76
-    for a in "${APPS_AVAILABLE[@]}"
76
+    # shellcheck disable=SC2068
77
+    for a in ${APPS_AVAILABLE[@]}
77 78
     do
78 79
         echo $"Turning on logging for ${a}"
79 80
         "logging_on_${a}"
@@ -83,7 +84,8 @@ function turn_logging_on {
83 84
 function turn_logging_off {
84 85
     logging_get_app_names
85 86
 
86
-    for a in "${APPS_AVAILABLE[@]}"
87
+    # shellcheck disable=SC2068
88
+    for a in ${APPS_AVAILABLE[@]}
87 89
     do
88 90
         echo $"Turning off logging for ${a}"
89 91
         "logging_off_${a}"

+ 2
- 1
src/freedombone-mesh-blog 查看文件

@@ -187,7 +187,8 @@ function change_theme {
187 187
     if [ -f /tmp/.blog-themes ]; then
188 188
         rm /tmp/.blog-themes
189 189
     fi
190
-    for a in "${THEMES[@]}"
190
+    # shellcheck disable=SC2068
191
+    for a in ${THEMES[@]}
191 192
     do
192 193
         echo "$n $a" >> /tmp/.blog-themes
193 194
         n=$((n+1))

+ 2
- 1
src/freedombone-rmuser 查看文件

@@ -124,7 +124,8 @@ fi
124 124
 echo $'Detecting installed apps...'
125 125
 detect_apps
126 126
 get_apps_installed_names
127
-for app_name in "${APPS_INSTALLED_NAMES[@]}"
127
+# shellcheck disable=SC2068
128
+for app_name in ${APPS_INSTALLED_NAMES[@]}
128 129
 do
129 130
     if [[ $(function_exists "remove_user_${app_name}") == "1" ]]; then
130 131
         echo $"Removing user from ${app_name}"

+ 2
- 1
src/freedombone-tests 查看文件

@@ -124,7 +124,8 @@ function test_app_functions {
124 124
     for filename in $FILES
125 125
     do
126 126
         # for each expected interface function
127
-        for f in "${interface_functions[@]}"
127
+        # shellcheck disable=SC2068
128
+        for f in ${interface_functions[@]}
128 129
         do
129 130
             test_app_function_type "${filename}" "$f"
130 131
         done

+ 6
- 3
src/freedombone-utils-backup 查看文件

@@ -543,7 +543,8 @@ function backup_apps {
543 543
     detect_installable_apps
544 544
     get_apps_installed_names
545 545
 
546
-    for app_name in "${APPS_INSTALLED_NAMES[@]}"
546
+    # shellcheck disable=SC2068
547
+    for app_name in ${APPS_INSTALLED_NAMES[@]}
547 548
     do
548 549
         echo $"Backup ${app_name}"
549 550
         app_load_variables "${app_name}"
@@ -563,7 +564,8 @@ function restore_apps {
563 564
     detect_installable_apps
564 565
     get_apps_installed_names
565 566
 
566
-    for app_name in "${APPS_INSTALLED_NAMES[@]}"
567
+    # shellcheck disable=SC2068
568
+    for app_name in ${APPS_INSTALLED_NAMES[@]}
567 569
     do
568 570
         confirm_restore=
569 571
         if [ ! "$2" ]; then
@@ -807,7 +809,8 @@ function valid_backup_destination {
807 809
     available_variants_list=()
808 810
     available_system_variants
809 811
 
810
-    if ! item_in_array "${destination_dir}" "${available_variants_list[@]}"; then
812
+    # shellcheck disable=SC2068
813
+    if ! item_in_array "${destination_dir}" ${available_variants_list[@]}; then
811 814
         is_valid="no"
812 815
     fi
813 816
 

+ 7
- 4
src/freedombone-utils-config 查看文件

@@ -279,7 +279,8 @@ function remove_completion_param {
279 279
 }
280 280
 
281 281
 function save_configuration_values {
282
-    for v in "${configuration_variables[@]}"
282
+    # shellcheck disable=SC2068
283
+    for v in ${configuration_variables[@]}
283 284
     do
284 285
         write_config_param "$v" "${!v}"
285 286
     done
@@ -299,7 +300,8 @@ function read_configuration_values {
299 300
             cp "$CONFIGURATION_FILE" "/root/${PROJECT_NAME}.cfg"
300 301
         fi
301 302
 
302
-        for v in "${configuration_variables[@]}"
303
+        # shellcheck disable=SC2068
304
+        for v in ${configuration_variables[@]}
303 305
         do
304 306
             read_config_param "$v"
305 307
         done
@@ -337,13 +339,14 @@ function check_domains {
337 339
     domains_array=("$specified_domains")
338 340
     checked_domains=()
339 341
 
340
-    for d in "${domains_array[@]}"
342
+    # shellcheck disable=SC2068
343
+    for d in ${domains_array[@]}
341 344
     do
342 345
         domain_param=$(echo "$d" | awk -F '=' '{print $1}')
343 346
         if [[ "$domain_param" != "DEFAULT_DOMAIN_NAME" ]]; then
344 347
             domain_value=$(echo "$d" | awk -F '=' '{print $2}')
345 348
             if [[ "$domain_value" != "${LOCAL_NAME}.local" ]]; then
346
-                if ! item_in_array "${domain_value}" "${checked_domains[@]}"; then
349
+                if ! item_in_array "${domain_value}" ${checked_domains[@]}; then
347 350
                     # test that this is a valid domain name
348 351
                     function_check test_domain_name
349 352
                     test_domain_name "$domain_value"

+ 31
- 16
src/freedombone-utils-selector 查看文件

@@ -69,7 +69,8 @@ function app_load_variables {
69 69
 
70 70
     #shellcheck disable=SC2206
71 71
     configvarname=( ${!configvarname} )
72
-    for v in "${configvarname[@]}"
72
+    # shellcheck disable=SC2068
73
+    for v in ${configvarname[@]}
73 74
     do
74 75
         read_config_param "$v"
75 76
     done
@@ -90,7 +91,8 @@ function app_save_variables {
90 91
 
91 92
     #shellcheck disable=SC2206
92 93
     configvarname=( ${!configvarname} )
93
-    for v in "${configvarname[@]}"
94
+    # shellcheck disable=SC2068
95
+    for v in ${configvarname[@]}
94 96
     do
95 97
         write_config_param "$v" "${!v}"
96 98
     done
@@ -128,9 +130,10 @@ function available_system_variants {
128 130
         system_variants_list=$(app_variants "$filename")
129 131
         # shellcheck disable=SC2206
130 132
         variants_array=($system_variants_list)
131
-        for variant_str in "${variants_array[@]}"
133
+        # shellcheck disable=SC2068
134
+        for variant_str in ${variants_array[@]}
132 135
         do
133
-            if ! item_in_array "${variant_str}" "${new_available_variants_list[@]}"; then
136
+            if ! item_in_array "${variant_str}" ${new_available_variants_list[@]}; then
134 137
                 new_available_variants_list+=("$variant_str")
135 138
             fi
136 139
         done
@@ -146,7 +149,8 @@ function is_valid_variant {
146 149
     function_check available_system_variants
147 150
     available_system_variants
148 151
 
149
-    for variant_str in "${available_variants_list[@]}"
152
+    # shellcheck disable=SC2068
153
+    for variant_str in ${available_variants_list[@]}
150 154
     do
151 155
         if [[ "$sys_type" == "$variant_str" ]]; then
152 156
             return "1"
@@ -161,7 +165,8 @@ function show_available_variants {
161 165
     function_check available_system_variants
162 166
     available_system_variants
163 167
 
164
-    for variant_str in "${available_variants_list[@]}"
168
+    # shellcheck disable=SC2068
169
+    for variant_str in ${available_variants_list[@]}
165 170
     do
166 171
         echo "  $variant_str"
167 172
     done
@@ -250,7 +255,8 @@ function install_completed {
250 255
 
251 256
 # populates an array of "0" or "1" for whether apps are installed
252 257
 function get_apps_installed {
253
-    for a in "${APPS_AVAILABLE[@]}"
258
+    # shellcheck disable=SC2068
259
+    for a in ${APPS_AVAILABLE[@]}
254 260
     do
255 261
         APPS_INSTALLED+=("$(app_is_installed "$a")")
256 262
     done
@@ -259,7 +265,8 @@ function get_apps_installed {
259 265
 # populates an array of installed app names
260 266
 function get_apps_installed_names {
261 267
     APPS_INSTALLED_NAMES=()
262
-    for a in "${APPS_AVAILABLE[@]}"
268
+    # shellcheck disable=SC2068
269
+    for a in ${APPS_AVAILABLE[@]}
263 270
     do
264 271
         if [[ $(app_is_installed "$a") == "1" ]]; then
265 272
             APPS_INSTALLED_NAMES+=("$a")
@@ -281,7 +288,8 @@ function detect_apps {
281 288
     do
282 289
         app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
283 290
 
284
-        if ! item_in_array "${app_name}" "${APPS_AVAILABLE[@]}"; then
291
+        # shellcheck disable=SC2068
292
+        if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
285 293
             APPS_AVAILABLE+=("${app_name}")
286 294
             APPS_CHOSEN+=("0")
287 295
         fi
@@ -312,7 +320,8 @@ function detect_installable_apps {
312 320
     do
313 321
         app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
314 322
 
315
-        if ! item_in_array "${app_name}" "${APPS_AVAILABLE[@]}"; then
323
+        # shellcheck disable=SC2068
324
+        if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
316 325
             variants_list=$(app_variants "$filename")
317 326
             # check for empty string
318 327
             if [ ${#variants_list} -gt 0 ]; then
@@ -344,7 +353,8 @@ function detect_installed_apps {
344 353
         app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
345 354
 
346 355
         if [[ $(app_is_installed "$app_name") == "1" ]]; then
347
-            if ! item_in_array "${app_name}" "${APPS_AVAILABLE[@]}"; then
356
+            # shellcheck disable=SC2068
357
+            if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
348 358
                 variants_list=$(app_variants "$filename")
349 359
                 if [ ${#variants_list} -gt 0 ]; then
350 360
                     APPS_AVAILABLE+=("${app_name}")
@@ -378,7 +388,8 @@ function choose_apps_for_variant {
378 388
     do
379 389
         app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
380 390
 
381
-        if item_in_array "${app_name}" "${APPS_AVAILABLE[@]}"; then
391
+        # shellcheck disable=SC2068
392
+        if item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
382 393
             if grep -q "VARIANTS=" "${filename}"; then
383 394
                 variants_list=$(app_variants "$filename")
384 395
                 if [[ "${variants_list}" == 'all'* || \
@@ -408,7 +419,8 @@ function choose_apps_for_variant {
408 419
 # show a list of apps which have been chosen
409 420
 function list_chosen_apps {
410 421
     app_index=0
411
-    for a in "${APPS_AVAILABLE[@]}"
422
+    # shellcheck disable=SC2068
423
+    for a in ${APPS_AVAILABLE[@]}
412 424
     do
413 425
         if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
414 426
             echo $"${a}"
@@ -419,7 +431,8 @@ function list_chosen_apps {
419 431
 
420 432
 function remove_apps {
421 433
     app_index=0
422
-    for a in "${APPS_AVAILABLE[@]}"
434
+    # shellcheck disable=SC2068
435
+    for a in ${APPS_AVAILABLE[@]}
423 436
     do
424 437
         if [[ ${APPS_INSTALLED[$app_index]} == "1" ]]; then
425 438
             if [[ ${APPS_CHOSEN[$app_index]} == "0" ]]; then
@@ -450,7 +463,8 @@ function remove_apps {
450 463
 function install_apps_interactive {
451 464
     echo $"Interactive installer"
452 465
     app_index=0
453
-    for a in "${APPS_AVAILABLE[@]}"
466
+    # shellcheck disable=SC2068
467
+    for a in ${APPS_AVAILABLE[@]}
454 468
     do
455 469
         if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
456 470
             if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
@@ -546,7 +560,8 @@ function install_apps {
546 560
 
547 561
     # now install the apps
548 562
     app_index=0
549
-    for a in "${APPS_AVAILABLE[@]}"
563
+    # shellcheck disable=SC2068
564
+    for a in ${APPS_AVAILABLE[@]}
550 565
     do
551 566
         if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
552 567
             if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then

+ 2
- 1
src/freedombone-utils-setup 查看文件

@@ -1105,7 +1105,8 @@ function upgrade_apps {
1105 1105
     do
1106 1106
         app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
1107 1107
 
1108
-        if ! item_in_array "${app_name}" "${APPS_COMPLETED[@]}"; then
1108
+        # shellcheck disable=SC2068
1109
+        if ! item_in_array "${app_name}" ${APPS_COMPLETED[@]}; then
1109 1110
             function_check app_is_installed
1110 1111
             if [[ "$(app_is_installed "$app_name")" == "1" ]]; then
1111 1112
                 echo ''