Browse Source

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

Bob Mottram 7 years ago
parent
commit
4701bf16a9

+ 8
- 4
src/freedombone-addremove View File

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

+ 2
- 1
src/freedombone-adduser View File

211
 echo $'Detecting installed apps...'
211
 echo $'Detecting installed apps...'
212
 detect_apps
212
 detect_apps
213
 get_apps_installed_names
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
 do
216
 do
216
     if [[ $(function_exists "add_user_${app_name}") == "1" ]]; then
217
     if [[ $(function_exists "add_user_${app_name}") == "1" ]]; then
217
         echo $"Adding user to ${app_name}"
218
         echo $"Adding user to ${app_name}"

+ 2
- 1
src/freedombone-app-pelican View File

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

+ 15
- 7
src/freedombone-app-pleroma View File

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

+ 2
- 1
src/freedombone-backup-local View File

228
         "/root/.passwords,                      passwordstore"
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
     do
233
     do
233
         # if this directory exists then back it up to the given destination
234
         # if this directory exists then back it up to the given destination
234
         source_directory=$(echo "$dr" | awk -F ',' '{print $1}'  | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
235
         source_directory=$(echo "$dr" | awk -F ',' '{print $1}'  | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')

+ 4
- 2
src/freedombone-config View File

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

+ 10
- 5
src/freedombone-controlpanel View File

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

+ 2
- 1
src/freedombone-controlpanel-user View File

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

+ 4
- 2
src/freedombone-freedns View File

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

+ 6
- 3
src/freedombone-image View File

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

+ 4
- 2
src/freedombone-logging View File

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

+ 2
- 1
src/freedombone-mesh-blog View File

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

+ 2
- 1
src/freedombone-rmuser View File

124
 echo $'Detecting installed apps...'
124
 echo $'Detecting installed apps...'
125
 detect_apps
125
 detect_apps
126
 get_apps_installed_names
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
 do
129
 do
129
     if [[ $(function_exists "remove_user_${app_name}") == "1" ]]; then
130
     if [[ $(function_exists "remove_user_${app_name}") == "1" ]]; then
130
         echo $"Removing user from ${app_name}"
131
         echo $"Removing user from ${app_name}"

+ 2
- 1
src/freedombone-tests View File

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

+ 6
- 3
src/freedombone-utils-backup View File

543
     detect_installable_apps
543
     detect_installable_apps
544
     get_apps_installed_names
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
     do
548
     do
548
         echo $"Backup ${app_name}"
549
         echo $"Backup ${app_name}"
549
         app_load_variables "${app_name}"
550
         app_load_variables "${app_name}"
563
     detect_installable_apps
564
     detect_installable_apps
564
     get_apps_installed_names
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
     do
569
     do
568
         confirm_restore=
570
         confirm_restore=
569
         if [ ! "$2" ]; then
571
         if [ ! "$2" ]; then
807
     available_variants_list=()
809
     available_variants_list=()
808
     available_system_variants
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
         is_valid="no"
814
         is_valid="no"
812
     fi
815
     fi
813
 
816
 

+ 7
- 4
src/freedombone-utils-config View File

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

+ 31
- 16
src/freedombone-utils-selector View File

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

+ 2
- 1
src/freedombone-utils-setup View File

1105
     do
1105
     do
1106
         app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
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
             function_check app_is_installed
1110
             function_check app_is_installed
1110
             if [[ "$(app_is_installed "$app_name")" == "1" ]]; then
1111
             if [[ "$(app_is_installed "$app_name")" == "1" ]]; then
1111
                 echo ''
1112
                 echo ''