Преглед изворни кода

Menu style during installation steps

Bob Mottram пре 7 година
родитељ
комит
17a2a66e0b
1 измењених фајлова са 252 додато и 256 уклоњено
  1. 252
    256
      src/freedombone-config

+ 252
- 256
src/freedombone-config Прегледај датотеку

@@ -323,52 +323,53 @@ function choose_default_domain_name {
323 323
 }
324 324
 
325 325
 function dynamic_dns_setup {
326
-    data=$(mktemp 2>/dev/null)
327
-    dialog --backtitle $"Freedombone Configuration" \
328
-           --radiolist $"Choose Dynamic DNS provider:" 40 40 40 \
329
-           1 dyn.com off \
330
-           2 freedns.afraid.org on \
331
-           3 zoneedit.com off \
332
-           4 no-ip.com off \
333
-           5 easydns.com off \
334
-           6 tzo.com off \
335
-           7 3322.org off \
336
-           8 dnsomatic.com off \
337
-           9 dns.he.net off \
338
-           10 tunnelbroker.net off \
339
-           11 dynsip.org off \
340
-           12 sitelutions.com off \
341
-           13 dnsexit.com off \
342
-           14 changeip.com off \
343
-           15 zerigo.com off \
344
-           16 dhis.org off \
345
-           17 nsupdate.info off \
346
-           18 duckdns.org off \
347
-           19 loopia.com off \
348
-           20 namecheap.com off \
349
-           21 domains.google.com off \
350
-           22 ovh.com off \
351
-           23 dtdns.com off \
352
-           24 giradns.com off \
353
-           25 duiadns.net off \
354
-           26 ddnss.de off \
355
-           27 dynv6.com off \
356
-           28 ipv4.dynv6.com off \
357
-           29 default@spdyn.de off \
358
-           30 strato.com off \
359
-           31 freemyip.com off \
360
-           32 cloudxns.net off \
361
-           33 none off 2> "$data"
362
-    sel=$?
363
-    case $sel in
364
-        1) rm -f "$data"
365
-           exit 1;;
366
-        255) rm -f "$data"
367
-             exit 1;;
368
-    esac
369
-    case $(cat "$data") in
370
-        1) DDNS_PROVIDER="default@www.dyn.com";;
371
-        2) DDNS_PROVIDER="default@freedns.afraid.org";;
326
+    W=(1 freedns.afraid.org
327
+       2 dyn.com
328
+       3 zoneedit.com
329
+       4 no-ip.com
330
+       5 easydns.com
331
+       6 tzo.com
332
+       7 3322.org
333
+       8 dnsomatic.com
334
+       9 dns.he.net
335
+       10 tunnelbroker.net
336
+       11 dynsip.org
337
+       12 sitelutions.com
338
+       13 dnsexit.com
339
+       14 changeip.com
340
+       15 zerigo.com
341
+       16 dhis.org
342
+       17 nsupdate.info
343
+       18 duckdns.org
344
+       19 loopia.com
345
+       20 namecheap.com
346
+       21 domains.google.com
347
+       22 ovh.com
348
+       23 dtdns.com
349
+       24 giradns.com
350
+       25 duiadns.net
351
+       26 ddnss.de
352
+       27 dynv6.com
353
+       28 ipv4.dynv6.com
354
+       29 default@spdyn.de
355
+       30 strato.com
356
+       31 freemyip.com
357
+       32 cloudxns.net)
358
+
359
+    # shellcheck disable=SC2068
360
+    selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Dynamic DNS" --menu $"Choose Dynamic DNS provider, or ESC for none:" 24 60 32 "${W[@]}" 3>&2 2>&1 1>&3)
361
+
362
+    if [ ! "$selection" ]; then
363
+        if [ -f /etc/systemd/system/inadyn.service ]; then
364
+            systemctl stop inadyn
365
+            systemctl disable inadyn
366
+        fi
367
+        return
368
+    fi
369
+
370
+    case $selection in
371
+        1) DDNS_PROVIDER="default@freedns.afraid.org";;
372
+        2) DDNS_PROVIDER="default@www.dyn.com";;
372 373
         3) DDNS_PROVIDER="default@www.zoneedit.com";;
373 374
         4) DDNS_PROVIDER="default@www.no-ip.com";;
374 375
         5) DDNS_PROVIDER="default@www.easydns.com";;
@@ -400,10 +401,7 @@ function dynamic_dns_setup {
400 401
         31) DDNS_PROVIDER="default@freemyip.com";;
401 402
         32) DDNS_PROVIDER="default@www.cloudxns.net";;
402 403
         33) DDNS_PROVIDER="none";;
403
-        255) rm -f "$data"
404
-             exit 1;;
405 404
     esac
406
-    rm -f "$data"
407 405
     save_configuration_values
408 406
 
409 407
     valid_ddns_username=
@@ -425,6 +423,7 @@ function dynamic_dns_setup {
425 423
                     if [ "$possible_username" ]; then
426 424
                         if [ ${#possible_username} -gt 1 ]; then
427 425
                             valid_ddns_username=$(cat "$data")
426
+                            # shellcheck disable=SC2034
428 427
                             DDNS_USERNAME="$valid_ddns_username"
429 428
                             rm -f "$data"
430 429
                             break;
@@ -491,121 +490,118 @@ function choose_dynamic_dns {
491 490
 
492 491
 function choose_debian_repo {
493 492
     if [[ "$MINIMAL_INSTALL" == "no" ]]; then
494
-        data=$(mktemp 2>/dev/null)
495
-        dialog --backtitle $"Freedombone Configuration" \
496
-               --radiolist $"Where to download Debian packages from:" 25 45 49 \
497
-               1 $"Australia" off \
498
-               2 $"Austria" off \
499
-               3 $"Belarus" off \
500
-               4 $"Belgium" off \
501
-               5 $"Bosnia and Herzegovina" off \
502
-               6 $"Brazil" off \
503
-               7 $"Bulgaria" off \
504
-               8 $"Canada" off \
505
-               9 $"Chile" off \
506
-               10 $"China" off \
507
-               11 $"Croatia" off \
508
-               12 $"Czech Republic" off \
509
-               13 $"Denmark" off \
510
-               14 $"El Salvador" off \
511
-               15 $"Estonia" off \
512
-               16 $"Finland" off \
513
-               17 $"France 1" off \
514
-               18 $"France 2" off \
515
-               19 $"Germany 1" off \
516
-               20 $"Germany 2" off \
517
-               21 $"Greece" off \
518
-               22 $"Hungary" off \
519
-               23 $"Iceland" off \
520
-               24 $"Iran" off \
521
-               25 $"Ireland" off \
522
-               26 $"Italy" off \
523
-               27 $"Japan" off \
524
-               28 $"Korea" off \
525
-               29 $"Lithuania" off \
526
-               30 $"Mexico" off \
527
-               31 $"Netherlands" off \
528
-               32 $"New Caledonia" off \
529
-               33 $"New Zealand" off \
530
-               34 $"Norway" off \
531
-               35 $"Poland" off \
532
-               36 $"Portugal" off \
533
-               37 $"Romania" off \
534
-               38 $"Russia" off \
535
-               39 $"Slovakia" off \
536
-               40 $"Slovenia" off \
537
-               41 $"Spain" off \
538
-               42 $"Sweden" off \
539
-               43 $"Switzerland" off \
540
-               44 $"Taiwan" off \
541
-               45 $"Thailand" off \
542
-               46 $"Turkey" off \
543
-               47 $"Ukraine" off \
544
-               48 $"United Kingdom" off \
545
-               49 $"United States" on 2> "$data"
546
-        sel=$?
547
-        case $sel in
548
-            1) rm -f "$data"
549
-               exit 1;;
550
-            255) rm -f "$data"
551
-                 exit 1;;
552
-        esac
553
-        case $(cat "$data") in
554
-            1) DEBIAN_REPO='ftp.au.debian.org';;
555
-            2) DEBIAN_REPO='ftp.at.debian.org';;
556
-            3) DEBIAN_REPO='ftp.by.debian.org';;
557
-            4) DEBIAN_REPO='ftp.be.debian.org';;
558
-            5) DEBIAN_REPO='ftp.ba.debian.org';;
559
-            6) DEBIAN_REPO='ftp.br.debian.org';;
560
-            7) DEBIAN_REPO='ftp.bg.debian.org';;
561
-            8) DEBIAN_REPO='ftp.ca.debian.org';;
562
-            9) DEBIAN_REPO='ftp.cl.debian.org';;
563
-            10) DEBIAN_REPO='ftp.cn.debian.org';;
564
-            11) DEBIAN_REPO='ftp.hr.debian.org';;
565
-            12) DEBIAN_REPO='ftp.cz.debian.org';;
566
-            13) DEBIAN_REPO='ftp.dk.debian.org';;
567
-            14) DEBIAN_REPO='ftp.sv.debian.org';;
568
-            15) DEBIAN_REPO='ftp.ee.debian.org';;
569
-            16) DEBIAN_REPO='ftp.fi.debian.org';;
570
-            17) DEBIAN_REPO='ftp2.fr.debian.org';;
571
-            18) DEBIAN_REPO='ftp.fr.debian.org';;
572
-            19) DEBIAN_REPO='ftp2.de.debian.org';;
573
-            20) DEBIAN_REPO='ftp.de.debian.org';;
574
-            21) DEBIAN_REPO='ftp.gr.debian.org';;
575
-            22) DEBIAN_REPO='ftp.hu.debian.org';;
576
-            23) DEBIAN_REPO='ftp.is.debian.org';;
577
-            24) DEBIAN_REPO='ftp.ir.debian.org';;
578
-            25) DEBIAN_REPO='ftp.ie.debian.org';;
579
-            26) DEBIAN_REPO='ftp.it.debian.org';;
580
-            27) DEBIAN_REPO='ftp.jp.debian.org';;
581
-            28) DEBIAN_REPO='ftp.kr.debian.org';;
582
-            29) DEBIAN_REPO='ftp.lt.debian.org';;
583
-            30) DEBIAN_REPO='ftp.mx.debian.org';;
584
-            31) DEBIAN_REPO='ftp.nl.debian.org';;
585
-            32) DEBIAN_REPO='ftp.nc.debian.org';;
586
-            33) DEBIAN_REPO='ftp.nz.debian.org';;
587
-            34) DEBIAN_REPO='ftp.no.debian.org';;
588
-            35) DEBIAN_REPO='ftp.pl.debian.org';;
589
-            36) DEBIAN_REPO='ftp.pt.debian.org';;
590
-            37) DEBIAN_REPO='ftp.ro.debian.org';;
591
-            38) DEBIAN_REPO='ftp.ru.debian.org';;
592
-            39) DEBIAN_REPO='ftp.sk.debian.org';;
593
-            40) DEBIAN_REPO='ftp.si.debian.org';;
594
-            41) DEBIAN_REPO='ftp.es.debian.org';;
595
-            42) DEBIAN_REPO='ftp.se.debian.org';;
596
-            43) DEBIAN_REPO='ftp.ch.debian.org';;
597
-            44) DEBIAN_REPO='ftp.tw.debian.org';;
598
-            45) DEBIAN_REPO='ftp.th.debian.org';;
599
-            46) DEBIAN_REPO='ftp.tr.debian.org';;
600
-            47) DEBIAN_REPO='ftp.ua.debian.org';;
601
-            48) DEBIAN_REPO='ftp.uk.debian.org';;
602
-            49) DEBIAN_REPO='ftp.us.debian.org';;
603
-            255) rm -f "$data"
604
-                 exit 1;;
493
+
494
+        W=(1 $"United Kingdom"
495
+           2 $"United States"
496
+           3 $"Australia"
497
+           4 $"Austria"
498
+           5 $"Belarus"
499
+           6 $"Belgium"
500
+           7 $"Bosnia and Herzegovina"
501
+           8 $"Brazil"
502
+           9 $"Bulgaria"
503
+           10 $"Canada"
504
+           11 $"Chile"
505
+           12 $"China"
506
+           13 $"Croatia"
507
+           14 $"Czech Republic"
508
+           15 $"Denmark"
509
+           16 $"El Salvador"
510
+           17 $"Estonia"
511
+           18 $"Finland"
512
+           19 $"France 1"
513
+           20 $"France 2"
514
+           21 $"Germany 1"
515
+           22 $"Germany 2"
516
+           23 $"Greece"
517
+           24 $"Hungary"
518
+           25 $"Iceland"
519
+           26 $"Iran"
520
+           27 $"Ireland"
521
+           28 $"Italy"
522
+           29 $"Japan"
523
+           30 $"Korea"
524
+           31 $"Lithuania"
525
+           32 $"Mexico"
526
+           33 $"Netherlands"
527
+           34 $"New Caledonia"
528
+           35 $"New Zealand"
529
+           36 $"Norway"
530
+           37 $"Poland"
531
+           38 $"Portugal"
532
+           39 $"Romania"
533
+           40 $"Russia"
534
+           41 $"Slovakia"
535
+           42 $"Slovenia"
536
+           43 $"Spain"
537
+           44 $"Sweden"
538
+           45 $"Switzerland"
539
+           46 $"Taiwan"
540
+           47 $"Thailand"
541
+           48 $"Turkey"
542
+           49 $"Ukraine")
543
+
544
+        # shellcheck disable=SC2068
545
+        selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Debian Repo" --menu $"Where to download Debian packages from:" 24 60 49 "${W[@]}" 3>&2 2>&1 1>&3)
546
+
547
+        if [ ! "$selection" ]; then
548
+            selection='1'
549
+        fi
550
+
551
+        case $selection in
552
+            1) DEBIAN_REPO='ftp.uk.debian.org';;
553
+            2) DEBIAN_REPO='ftp.us.debian.org';;
554
+            3) DEBIAN_REPO='ftp.au.debian.org';;
555
+            4) DEBIAN_REPO='ftp.at.debian.org';;
556
+            5) DEBIAN_REPO='ftp.by.debian.org';;
557
+            6) DEBIAN_REPO='ftp.be.debian.org';;
558
+            7) DEBIAN_REPO='ftp.ba.debian.org';;
559
+            8) DEBIAN_REPO='ftp.br.debian.org';;
560
+            9) DEBIAN_REPO='ftp.bg.debian.org';;
561
+            10) DEBIAN_REPO='ftp.ca.debian.org';;
562
+            11) DEBIAN_REPO='ftp.cl.debian.org';;
563
+            12) DEBIAN_REPO='ftp.cn.debian.org';;
564
+            13) DEBIAN_REPO='ftp.hr.debian.org';;
565
+            14) DEBIAN_REPO='ftp.cz.debian.org';;
566
+            15) DEBIAN_REPO='ftp.dk.debian.org';;
567
+            16) DEBIAN_REPO='ftp.sv.debian.org';;
568
+            17) DEBIAN_REPO='ftp.ee.debian.org';;
569
+            18) DEBIAN_REPO='ftp.fi.debian.org';;
570
+            19) DEBIAN_REPO='ftp2.fr.debian.org';;
571
+            20) DEBIAN_REPO='ftp.fr.debian.org';;
572
+            21) DEBIAN_REPO='ftp2.de.debian.org';;
573
+            22) DEBIAN_REPO='ftp.de.debian.org';;
574
+            23) DEBIAN_REPO='ftp.gr.debian.org';;
575
+            24) DEBIAN_REPO='ftp.hu.debian.org';;
576
+            25) DEBIAN_REPO='ftp.is.debian.org';;
577
+            26) DEBIAN_REPO='ftp.ir.debian.org';;
578
+            27) DEBIAN_REPO='ftp.ie.debian.org';;
579
+            28) DEBIAN_REPO='ftp.it.debian.org';;
580
+            29) DEBIAN_REPO='ftp.jp.debian.org';;
581
+            30) DEBIAN_REPO='ftp.kr.debian.org';;
582
+            31) DEBIAN_REPO='ftp.lt.debian.org';;
583
+            32) DEBIAN_REPO='ftp.mx.debian.org';;
584
+            33) DEBIAN_REPO='ftp.nl.debian.org';;
585
+            34) DEBIAN_REPO='ftp.nc.debian.org';;
586
+            35) DEBIAN_REPO='ftp.nz.debian.org';;
587
+            36) DEBIAN_REPO='ftp.no.debian.org';;
588
+            37) DEBIAN_REPO='ftp.pl.debian.org';;
589
+            38) DEBIAN_REPO='ftp.pt.debian.org';;
590
+            39) DEBIAN_REPO='ftp.ro.debian.org';;
591
+            40) DEBIAN_REPO='ftp.ru.debian.org';;
592
+            41) DEBIAN_REPO='ftp.sk.debian.org';;
593
+            42) DEBIAN_REPO='ftp.si.debian.org';;
594
+            43) DEBIAN_REPO='ftp.es.debian.org';;
595
+            44) DEBIAN_REPO='ftp.se.debian.org';;
596
+            45) DEBIAN_REPO='ftp.ch.debian.org';;
597
+            46) DEBIAN_REPO='ftp.tw.debian.org';;
598
+            47) DEBIAN_REPO='ftp.th.debian.org';;
599
+            48) DEBIAN_REPO='ftp.tr.debian.org';;
600
+            49) DEBIAN_REPO='ftp.ua.debian.org';;
605 601
         esac
606
-        rm -f "$data"
607 602
         save_configuration_values
608 603
     else
604
+        # shellcheck disable=SC2034
609 605
         DEBIAN_REPO='ftp.de.debian.org'
610 606
     fi
611 607
 }
@@ -634,6 +630,7 @@ function choose_rng {
634 630
                      exit 1;;
635 631
             esac
636 632
         else
633
+            # shellcheck disable=SC2034
637 634
             HWRNG_TYPE="beaglebone"
638 635
         fi
639 636
         rm -f "$data"
@@ -664,6 +661,7 @@ function choose_social_key_management {
664 661
         save_configuration_values
665 662
     else
666 663
         # enable for the minimal case
664
+        # shellcheck disable=SC2034
667 665
         ENABLE_SOCIAL_KEY_MANAGEMENT="yes"
668 666
     fi
669 667
 }
@@ -775,6 +773,7 @@ function choose_full_name {
775 773
                 if [ "$possible_name" ]; then
776 774
                     if [ ${#possible_name} -gt 1 ]; then
777 775
                         valid_name="$possible_name"
776
+                        # shellcheck disable=SC2034
778 777
                         MY_NAME="$possible_name"
779 778
                         break;
780 779
                     fi
@@ -885,100 +884,98 @@ do
885 884
 done
886 885
 
887 886
 function interactive_select_language {
888
-    data=$(mktemp 2>/dev/null)
889
-    dialog --backtitle $"Freedombone Configuration" \
890
-           --radiolist $"Select your language:" 26 40 24 \
891
-           1 $"Afrikaans" off \
892
-           2 $"Albanian" off \
893
-           3 $"Arabic" off \
894
-           4 $"Basque" off \
895
-           5 $"Belarusian" off \
896
-           6 $"Bosnian" off \
897
-           7 $"Bulgarian" off \
898
-           8 $"Catalan" off \
899
-           9 $"Croatian" off \
900
-           10 $"Chinese (Simplified)" off \
901
-           11 $"Chinese (Traditional)" off \
902
-           12 $"Czech" off \
903
-           13 $"Danish" off \
904
-           14 $"Dutch" off \
905
-           15 $"English" on \
906
-           16 $"English (US)" off \
907
-           17 $"Estonian" off \
908
-           18 $"Farsi" off \
909
-           19 $"Filipino" off \
910
-           20 $"Finnish" off \
911
-           21 $"French" off \
912
-           22 $"French (Canada)" off \
913
-           23 $"Gaelic" off \
914
-           24 $"Gallego" off \
915
-           25 $"Georgian" off \
916
-           26 $"German" off \
917
-           27 $"German (Personal)" off \
918
-           28 $"Greek" off \
919
-           29 $"Gujarati" off \
920
-           30 $"Hebrew" off \
921
-           31 $"Hindi" off \
922
-           32 $"Hungarian" off \
923
-           33 $"Icelandic" off \
924
-           34 $"Indonesian" off \
925
-           35 $"Italian" off \
926
-           36 $"Japanese" off \
927
-           37 $"Kannada" off \
928
-           38 $"Khmer" off \
929
-           39 $"Korean" off \
930
-           40 $"Lao" off \
931
-           41 $"Lithuanian" off \
932
-           42 $"Latvian" off \
933
-           43 $"Malayalam" off \
934
-           44 $"Malaysian" off \
935
-           45 $"Maori (Ngai Tahu)" off \
936
-           46 $"Maori (Waikoto Uni)" off \
937
-           47 $"Mongolian" off \
938
-           48 $"Norwegian" off \
939
-           49 $"Norwegian (Primary)" off \
940
-           50 $"Nynorsk" off \
941
-           51 $"Polish" off \
942
-           52 $"Portuguese" off \
943
-           53 $"Portuguese (Brazil)" off \
944
-           54 $"Romanian" off \
945
-           55 $"Russian" off \
946
-           56 $"Samoan" off \
947
-           57 $"Serbian" off \
948
-           58 $"Slovak" off \
949
-           59 $"Slovenian" off \
950
-           60 $"Somali" off \
951
-           61 $"Spanish (International)" off \
952
-           62 $"Swedish" off \
953
-           63 $"Tagalog" off \
954
-           64 $"Tamil" off \
955
-           65 $"Thai" off \
956
-           66 $"Turkish" off \
957
-           67 $"Ukrainian" off \
958
-           68 $"Vietnamese" off 2> "$data"
959
-    sel=$?
960
-    case $sel in
961
-        1) rm -f "$data"
962
-           exit 1;;
963
-        255) rm -f "$data"
964
-             exit 1;;
965
-    esac
966
-    case $(cat "$data") in
967
-        1) DEFAULT_LANGUAGE='af_ZA.UTF-8';;
968
-        2) DEFAULT_LANGUAGE='sq_AL.UTF-8';;
969
-        3) DEFAULT_LANGUAGE='ar_SA.UTF-8';;
970
-        4) DEFAULT_LANGUAGE='eu_ES.UTF-8';;
971
-        5) DEFAULT_LANGUAGE='be_BY.UTF-8';;
972
-        6) DEFAULT_LANGUAGE='bs_BA.UTF-8';;
973
-        7) DEFAULT_LANGUAGE='bg_BG.UTF-8';;
974
-        8) DEFAULT_LANGUAGE='ca_ES.UTF-8';;
975
-        9) DEFAULT_LANGUAGE='hr_HR.UTF-8';;
976
-        10) DEFAULT_LANGUAGE='zh_CN.UTF-8';;
977
-        11) DEFAULT_LANGUAGE='zh_TW.UTF-8';;
978
-        12) DEFAULT_LANGUAGE='cs_CZ.UTF-8';;
979
-        13) DEFAULT_LANGUAGE='da_DK.UTF-8';;
980
-        14) DEFAULT_LANGUAGE='nl_NL.UTF-8';;
981
-        15) DEFAULT_LANGUAGE='en_GB.UTF-8';;
887
+    W=(1 $"English"
888
+       2 $"Afrikaans"
889
+       3 $"Albanian"
890
+       4 $"Arabic"
891
+       5 $"Basque"
892
+       6 $"Belarusian"
893
+       7 $"Bosnian"
894
+       8 $"Bulgarian"
895
+       9 $"Catalan"
896
+       10 $"Croatian"
897
+       11 $"Chinese (Simplified)"
898
+       12 $"Chinese (Traditional)"
899
+       13 $"Czech"
900
+       14 $"Danish"
901
+       15 $"Dutch"
902
+       16 $"English (US)"
903
+       17 $"Estonian"
904
+       18 $"Farsi"
905
+       19 $"Filipino"
906
+       20 $"Finnish"
907
+       21 $"French"
908
+       22 $"French (Canada)"
909
+       23 $"Gaelic"
910
+       24 $"Gallego"
911
+       25 $"Georgian"
912
+       26 $"German"
913
+       27 $"German (Personal)"
914
+       28 $"Greek"
915
+       29 $"Gujarati"
916
+       30 $"Hebrew"
917
+       31 $"Hindi"
918
+       32 $"Hungarian"
919
+       33 $"Icelandic"
920
+       34 $"Indonesian"
921
+       35 $"Italian"
922
+       36 $"Japanese"
923
+       37 $"Kannada"
924
+       38 $"Khmer"
925
+       39 $"Korean"
926
+       40 $"Lao"
927
+       41 $"Lithuanian"
928
+       42 $"Latvian"
929
+       43 $"Malayalam"
930
+       44 $"Malaysian"
931
+       45 $"Maori (Ngai Tahu)"
932
+       46 $"Maori (Waikoto Uni)"
933
+       47 $"Mongolian"
934
+       48 $"Norwegian"
935
+       49 $"Norwegian (Primary)"
936
+       50 $"Nynorsk"
937
+       51 $"Polish"
938
+       52 $"Portuguese"
939
+       53 $"Portuguese (Brazil)"
940
+       54 $"Romanian"
941
+       55 $"Russian"
942
+       56 $"Samoan"
943
+       57 $"Serbian"
944
+       58 $"Slovak"
945
+       59 $"Slovenian"
946
+       60 $"Somali"
947
+       61 $"Spanish (International)"
948
+       62 $"Swedish"
949
+       63 $"Tagalog"
950
+       64 $"Tamil"
951
+       65 $"Thai"
952
+       66 $"Turkish"
953
+       67 $"Ukrainian"
954
+       68 $"Vietnamese")
955
+
956
+    # shellcheck disable=SC2068
957
+    selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Language" --menu $"Select your language:" 12 60 4 "${W[@]}" 3>&2 2>&1 1>&3)
958
+
959
+    if [ ! "$selection" ]; then
960
+        selection='1'
961
+    fi
962
+
963
+    case $selection in
964
+        1) DEFAULT_LANGUAGE='en_GB.UTF-8';;
965
+        2) DEFAULT_LANGUAGE='af_ZA.UTF-8';;
966
+        3) DEFAULT_LANGUAGE='sq_AL.UTF-8';;
967
+        4) DEFAULT_LANGUAGE='ar_SA.UTF-8';;
968
+        5) DEFAULT_LANGUAGE='eu_ES.UTF-8';;
969
+        6) DEFAULT_LANGUAGE='be_BY.UTF-8';;
970
+        7) DEFAULT_LANGUAGE='bs_BA.UTF-8';;
971
+        8) DEFAULT_LANGUAGE='bg_BG.UTF-8';;
972
+        9) DEFAULT_LANGUAGE='ca_ES.UTF-8';;
973
+        10) DEFAULT_LANGUAGE='hr_HR.UTF-8';;
974
+        11) DEFAULT_LANGUAGE='zh_CN.UTF-8';;
975
+        12) DEFAULT_LANGUAGE='zh_TW.UTF-8';;
976
+        13) DEFAULT_LANGUAGE='cs_CZ.UTF-8';;
977
+        14) DEFAULT_LANGUAGE='da_DK.UTF-8';;
978
+        15) DEFAULT_LANGUAGE='nl_NL.UTF-8';;
982 979
         16) DEFAULT_LANGUAGE='en_US.UTF-8';;
983 980
         17) DEFAULT_LANGUAGE='et_EE.UTF-8';;
984 981
         18) DEFAULT_LANGUAGE='fa_IR.UTF-8';;
@@ -1033,7 +1030,6 @@ function interactive_select_language {
1033 1030
         67) DEFAULT_LANGUAGE='uk_UA.UTF-8';;
1034 1031
         68) DEFAULT_LANGUAGE='vi_VN.UTF-8';;
1035 1032
     esac
1036
-    rm -f "$data"
1037 1033
     save_configuration_values
1038 1034
 
1039 1035
     please_wait