Menu style during installation steps

This commit is contained in:
Bob Mottram 2018-04-04 15:43:24 +01:00
parent 07752211e3
commit 17a2a66e0b
1 changed files with 252 additions and 256 deletions

View File

@ -323,52 +323,53 @@ function choose_default_domain_name {
} }
function dynamic_dns_setup { function dynamic_dns_setup {
data=$(mktemp 2>/dev/null) W=(1 freedns.afraid.org
dialog --backtitle $"Freedombone Configuration" \ 2 dyn.com
--radiolist $"Choose Dynamic DNS provider:" 40 40 40 \ 3 zoneedit.com
1 dyn.com off \ 4 no-ip.com
2 freedns.afraid.org on \ 5 easydns.com
3 zoneedit.com off \ 6 tzo.com
4 no-ip.com off \ 7 3322.org
5 easydns.com off \ 8 dnsomatic.com
6 tzo.com off \ 9 dns.he.net
7 3322.org off \ 10 tunnelbroker.net
8 dnsomatic.com off \ 11 dynsip.org
9 dns.he.net off \ 12 sitelutions.com
10 tunnelbroker.net off \ 13 dnsexit.com
11 dynsip.org off \ 14 changeip.com
12 sitelutions.com off \ 15 zerigo.com
13 dnsexit.com off \ 16 dhis.org
14 changeip.com off \ 17 nsupdate.info
15 zerigo.com off \ 18 duckdns.org
16 dhis.org off \ 19 loopia.com
17 nsupdate.info off \ 20 namecheap.com
18 duckdns.org off \ 21 domains.google.com
19 loopia.com off \ 22 ovh.com
20 namecheap.com off \ 23 dtdns.com
21 domains.google.com off \ 24 giradns.com
22 ovh.com off \ 25 duiadns.net
23 dtdns.com off \ 26 ddnss.de
24 giradns.com off \ 27 dynv6.com
25 duiadns.net off \ 28 ipv4.dynv6.com
26 ddnss.de off \ 29 default@spdyn.de
27 dynv6.com off \ 30 strato.com
28 ipv4.dynv6.com off \ 31 freemyip.com
29 default@spdyn.de off \ 32 cloudxns.net)
30 strato.com off \
31 freemyip.com off \ # shellcheck disable=SC2068
32 cloudxns.net off \ 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)
33 none off 2> "$data"
sel=$? if [ ! "$selection" ]; then
case $sel in if [ -f /etc/systemd/system/inadyn.service ]; then
1) rm -f "$data" systemctl stop inadyn
exit 1;; systemctl disable inadyn
255) rm -f "$data" fi
exit 1;; return
esac fi
case $(cat "$data") in
1) DDNS_PROVIDER="default@www.dyn.com";; case $selection in
2) DDNS_PROVIDER="default@freedns.afraid.org";; 1) DDNS_PROVIDER="default@freedns.afraid.org";;
2) DDNS_PROVIDER="default@www.dyn.com";;
3) DDNS_PROVIDER="default@www.zoneedit.com";; 3) DDNS_PROVIDER="default@www.zoneedit.com";;
4) DDNS_PROVIDER="default@www.no-ip.com";; 4) DDNS_PROVIDER="default@www.no-ip.com";;
5) DDNS_PROVIDER="default@www.easydns.com";; 5) DDNS_PROVIDER="default@www.easydns.com";;
@ -400,10 +401,7 @@ function dynamic_dns_setup {
31) DDNS_PROVIDER="default@freemyip.com";; 31) DDNS_PROVIDER="default@freemyip.com";;
32) DDNS_PROVIDER="default@www.cloudxns.net";; 32) DDNS_PROVIDER="default@www.cloudxns.net";;
33) DDNS_PROVIDER="none";; 33) DDNS_PROVIDER="none";;
255) rm -f "$data"
exit 1;;
esac esac
rm -f "$data"
save_configuration_values save_configuration_values
valid_ddns_username= valid_ddns_username=
@ -425,6 +423,7 @@ function dynamic_dns_setup {
if [ "$possible_username" ]; then if [ "$possible_username" ]; then
if [ ${#possible_username} -gt 1 ]; then if [ ${#possible_username} -gt 1 ]; then
valid_ddns_username=$(cat "$data") valid_ddns_username=$(cat "$data")
# shellcheck disable=SC2034
DDNS_USERNAME="$valid_ddns_username" DDNS_USERNAME="$valid_ddns_username"
rm -f "$data" rm -f "$data"
break; break;
@ -491,121 +490,118 @@ function choose_dynamic_dns {
function choose_debian_repo { function choose_debian_repo {
if [[ "$MINIMAL_INSTALL" == "no" ]]; then if [[ "$MINIMAL_INSTALL" == "no" ]]; then
data=$(mktemp 2>/dev/null)
dialog --backtitle $"Freedombone Configuration" \ W=(1 $"United Kingdom"
--radiolist $"Where to download Debian packages from:" 25 45 49 \ 2 $"United States"
1 $"Australia" off \ 3 $"Australia"
2 $"Austria" off \ 4 $"Austria"
3 $"Belarus" off \ 5 $"Belarus"
4 $"Belgium" off \ 6 $"Belgium"
5 $"Bosnia and Herzegovina" off \ 7 $"Bosnia and Herzegovina"
6 $"Brazil" off \ 8 $"Brazil"
7 $"Bulgaria" off \ 9 $"Bulgaria"
8 $"Canada" off \ 10 $"Canada"
9 $"Chile" off \ 11 $"Chile"
10 $"China" off \ 12 $"China"
11 $"Croatia" off \ 13 $"Croatia"
12 $"Czech Republic" off \ 14 $"Czech Republic"
13 $"Denmark" off \ 15 $"Denmark"
14 $"El Salvador" off \ 16 $"El Salvador"
15 $"Estonia" off \ 17 $"Estonia"
16 $"Finland" off \ 18 $"Finland"
17 $"France 1" off \ 19 $"France 1"
18 $"France 2" off \ 20 $"France 2"
19 $"Germany 1" off \ 21 $"Germany 1"
20 $"Germany 2" off \ 22 $"Germany 2"
21 $"Greece" off \ 23 $"Greece"
22 $"Hungary" off \ 24 $"Hungary"
23 $"Iceland" off \ 25 $"Iceland"
24 $"Iran" off \ 26 $"Iran"
25 $"Ireland" off \ 27 $"Ireland"
26 $"Italy" off \ 28 $"Italy"
27 $"Japan" off \ 29 $"Japan"
28 $"Korea" off \ 30 $"Korea"
29 $"Lithuania" off \ 31 $"Lithuania"
30 $"Mexico" off \ 32 $"Mexico"
31 $"Netherlands" off \ 33 $"Netherlands"
32 $"New Caledonia" off \ 34 $"New Caledonia"
33 $"New Zealand" off \ 35 $"New Zealand"
34 $"Norway" off \ 36 $"Norway"
35 $"Poland" off \ 37 $"Poland"
36 $"Portugal" off \ 38 $"Portugal"
37 $"Romania" off \ 39 $"Romania"
38 $"Russia" off \ 40 $"Russia"
39 $"Slovakia" off \ 41 $"Slovakia"
40 $"Slovenia" off \ 42 $"Slovenia"
41 $"Spain" off \ 43 $"Spain"
42 $"Sweden" off \ 44 $"Sweden"
43 $"Switzerland" off \ 45 $"Switzerland"
44 $"Taiwan" off \ 46 $"Taiwan"
45 $"Thailand" off \ 47 $"Thailand"
46 $"Turkey" off \ 48 $"Turkey"
47 $"Ukraine" off \ 49 $"Ukraine")
48 $"United Kingdom" off \
49 $"United States" on 2> "$data" # shellcheck disable=SC2068
sel=$? 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)
case $sel in
1) rm -f "$data" if [ ! "$selection" ]; then
exit 1;; selection='1'
255) rm -f "$data" fi
exit 1;;
case $selection in
1) DEBIAN_REPO='ftp.uk.debian.org';;
2) DEBIAN_REPO='ftp.us.debian.org';;
3) DEBIAN_REPO='ftp.au.debian.org';;
4) DEBIAN_REPO='ftp.at.debian.org';;
5) DEBIAN_REPO='ftp.by.debian.org';;
6) DEBIAN_REPO='ftp.be.debian.org';;
7) DEBIAN_REPO='ftp.ba.debian.org';;
8) DEBIAN_REPO='ftp.br.debian.org';;
9) DEBIAN_REPO='ftp.bg.debian.org';;
10) DEBIAN_REPO='ftp.ca.debian.org';;
11) DEBIAN_REPO='ftp.cl.debian.org';;
12) DEBIAN_REPO='ftp.cn.debian.org';;
13) DEBIAN_REPO='ftp.hr.debian.org';;
14) DEBIAN_REPO='ftp.cz.debian.org';;
15) DEBIAN_REPO='ftp.dk.debian.org';;
16) DEBIAN_REPO='ftp.sv.debian.org';;
17) DEBIAN_REPO='ftp.ee.debian.org';;
18) DEBIAN_REPO='ftp.fi.debian.org';;
19) DEBIAN_REPO='ftp2.fr.debian.org';;
20) DEBIAN_REPO='ftp.fr.debian.org';;
21) DEBIAN_REPO='ftp2.de.debian.org';;
22) DEBIAN_REPO='ftp.de.debian.org';;
23) DEBIAN_REPO='ftp.gr.debian.org';;
24) DEBIAN_REPO='ftp.hu.debian.org';;
25) DEBIAN_REPO='ftp.is.debian.org';;
26) DEBIAN_REPO='ftp.ir.debian.org';;
27) DEBIAN_REPO='ftp.ie.debian.org';;
28) DEBIAN_REPO='ftp.it.debian.org';;
29) DEBIAN_REPO='ftp.jp.debian.org';;
30) DEBIAN_REPO='ftp.kr.debian.org';;
31) DEBIAN_REPO='ftp.lt.debian.org';;
32) DEBIAN_REPO='ftp.mx.debian.org';;
33) DEBIAN_REPO='ftp.nl.debian.org';;
34) DEBIAN_REPO='ftp.nc.debian.org';;
35) DEBIAN_REPO='ftp.nz.debian.org';;
36) DEBIAN_REPO='ftp.no.debian.org';;
37) DEBIAN_REPO='ftp.pl.debian.org';;
38) DEBIAN_REPO='ftp.pt.debian.org';;
39) DEBIAN_REPO='ftp.ro.debian.org';;
40) DEBIAN_REPO='ftp.ru.debian.org';;
41) DEBIAN_REPO='ftp.sk.debian.org';;
42) DEBIAN_REPO='ftp.si.debian.org';;
43) DEBIAN_REPO='ftp.es.debian.org';;
44) DEBIAN_REPO='ftp.se.debian.org';;
45) DEBIAN_REPO='ftp.ch.debian.org';;
46) DEBIAN_REPO='ftp.tw.debian.org';;
47) DEBIAN_REPO='ftp.th.debian.org';;
48) DEBIAN_REPO='ftp.tr.debian.org';;
49) DEBIAN_REPO='ftp.ua.debian.org';;
esac esac
case $(cat "$data") in
1) DEBIAN_REPO='ftp.au.debian.org';;
2) DEBIAN_REPO='ftp.at.debian.org';;
3) DEBIAN_REPO='ftp.by.debian.org';;
4) DEBIAN_REPO='ftp.be.debian.org';;
5) DEBIAN_REPO='ftp.ba.debian.org';;
6) DEBIAN_REPO='ftp.br.debian.org';;
7) DEBIAN_REPO='ftp.bg.debian.org';;
8) DEBIAN_REPO='ftp.ca.debian.org';;
9) DEBIAN_REPO='ftp.cl.debian.org';;
10) DEBIAN_REPO='ftp.cn.debian.org';;
11) DEBIAN_REPO='ftp.hr.debian.org';;
12) DEBIAN_REPO='ftp.cz.debian.org';;
13) DEBIAN_REPO='ftp.dk.debian.org';;
14) DEBIAN_REPO='ftp.sv.debian.org';;
15) DEBIAN_REPO='ftp.ee.debian.org';;
16) DEBIAN_REPO='ftp.fi.debian.org';;
17) DEBIAN_REPO='ftp2.fr.debian.org';;
18) DEBIAN_REPO='ftp.fr.debian.org';;
19) DEBIAN_REPO='ftp2.de.debian.org';;
20) DEBIAN_REPO='ftp.de.debian.org';;
21) DEBIAN_REPO='ftp.gr.debian.org';;
22) DEBIAN_REPO='ftp.hu.debian.org';;
23) DEBIAN_REPO='ftp.is.debian.org';;
24) DEBIAN_REPO='ftp.ir.debian.org';;
25) DEBIAN_REPO='ftp.ie.debian.org';;
26) DEBIAN_REPO='ftp.it.debian.org';;
27) DEBIAN_REPO='ftp.jp.debian.org';;
28) DEBIAN_REPO='ftp.kr.debian.org';;
29) DEBIAN_REPO='ftp.lt.debian.org';;
30) DEBIAN_REPO='ftp.mx.debian.org';;
31) DEBIAN_REPO='ftp.nl.debian.org';;
32) DEBIAN_REPO='ftp.nc.debian.org';;
33) DEBIAN_REPO='ftp.nz.debian.org';;
34) DEBIAN_REPO='ftp.no.debian.org';;
35) DEBIAN_REPO='ftp.pl.debian.org';;
36) DEBIAN_REPO='ftp.pt.debian.org';;
37) DEBIAN_REPO='ftp.ro.debian.org';;
38) DEBIAN_REPO='ftp.ru.debian.org';;
39) DEBIAN_REPO='ftp.sk.debian.org';;
40) DEBIAN_REPO='ftp.si.debian.org';;
41) DEBIAN_REPO='ftp.es.debian.org';;
42) DEBIAN_REPO='ftp.se.debian.org';;
43) DEBIAN_REPO='ftp.ch.debian.org';;
44) DEBIAN_REPO='ftp.tw.debian.org';;
45) DEBIAN_REPO='ftp.th.debian.org';;
46) DEBIAN_REPO='ftp.tr.debian.org';;
47) DEBIAN_REPO='ftp.ua.debian.org';;
48) DEBIAN_REPO='ftp.uk.debian.org';;
49) DEBIAN_REPO='ftp.us.debian.org';;
255) rm -f "$data"
exit 1;;
esac
rm -f "$data"
save_configuration_values save_configuration_values
else else
# shellcheck disable=SC2034
DEBIAN_REPO='ftp.de.debian.org' DEBIAN_REPO='ftp.de.debian.org'
fi fi
} }
@ -634,6 +630,7 @@ function choose_rng {
exit 1;; exit 1;;
esac esac
else else
# shellcheck disable=SC2034
HWRNG_TYPE="beaglebone" HWRNG_TYPE="beaglebone"
fi fi
rm -f "$data" rm -f "$data"
@ -664,6 +661,7 @@ function choose_social_key_management {
save_configuration_values save_configuration_values
else else
# enable for the minimal case # enable for the minimal case
# shellcheck disable=SC2034
ENABLE_SOCIAL_KEY_MANAGEMENT="yes" ENABLE_SOCIAL_KEY_MANAGEMENT="yes"
fi fi
} }
@ -775,6 +773,7 @@ function choose_full_name {
if [ "$possible_name" ]; then if [ "$possible_name" ]; then
if [ ${#possible_name} -gt 1 ]; then if [ ${#possible_name} -gt 1 ]; then
valid_name="$possible_name" valid_name="$possible_name"
# shellcheck disable=SC2034
MY_NAME="$possible_name" MY_NAME="$possible_name"
break; break;
fi fi
@ -885,100 +884,98 @@ do
done done
function interactive_select_language { function interactive_select_language {
data=$(mktemp 2>/dev/null) W=(1 $"English"
dialog --backtitle $"Freedombone Configuration" \ 2 $"Afrikaans"
--radiolist $"Select your language:" 26 40 24 \ 3 $"Albanian"
1 $"Afrikaans" off \ 4 $"Arabic"
2 $"Albanian" off \ 5 $"Basque"
3 $"Arabic" off \ 6 $"Belarusian"
4 $"Basque" off \ 7 $"Bosnian"
5 $"Belarusian" off \ 8 $"Bulgarian"
6 $"Bosnian" off \ 9 $"Catalan"
7 $"Bulgarian" off \ 10 $"Croatian"
8 $"Catalan" off \ 11 $"Chinese (Simplified)"
9 $"Croatian" off \ 12 $"Chinese (Traditional)"
10 $"Chinese (Simplified)" off \ 13 $"Czech"
11 $"Chinese (Traditional)" off \ 14 $"Danish"
12 $"Czech" off \ 15 $"Dutch"
13 $"Danish" off \ 16 $"English (US)"
14 $"Dutch" off \ 17 $"Estonian"
15 $"English" on \ 18 $"Farsi"
16 $"English (US)" off \ 19 $"Filipino"
17 $"Estonian" off \ 20 $"Finnish"
18 $"Farsi" off \ 21 $"French"
19 $"Filipino" off \ 22 $"French (Canada)"
20 $"Finnish" off \ 23 $"Gaelic"
21 $"French" off \ 24 $"Gallego"
22 $"French (Canada)" off \ 25 $"Georgian"
23 $"Gaelic" off \ 26 $"German"
24 $"Gallego" off \ 27 $"German (Personal)"
25 $"Georgian" off \ 28 $"Greek"
26 $"German" off \ 29 $"Gujarati"
27 $"German (Personal)" off \ 30 $"Hebrew"
28 $"Greek" off \ 31 $"Hindi"
29 $"Gujarati" off \ 32 $"Hungarian"
30 $"Hebrew" off \ 33 $"Icelandic"
31 $"Hindi" off \ 34 $"Indonesian"
32 $"Hungarian" off \ 35 $"Italian"
33 $"Icelandic" off \ 36 $"Japanese"
34 $"Indonesian" off \ 37 $"Kannada"
35 $"Italian" off \ 38 $"Khmer"
36 $"Japanese" off \ 39 $"Korean"
37 $"Kannada" off \ 40 $"Lao"
38 $"Khmer" off \ 41 $"Lithuanian"
39 $"Korean" off \ 42 $"Latvian"
40 $"Lao" off \ 43 $"Malayalam"
41 $"Lithuanian" off \ 44 $"Malaysian"
42 $"Latvian" off \ 45 $"Maori (Ngai Tahu)"
43 $"Malayalam" off \ 46 $"Maori (Waikoto Uni)"
44 $"Malaysian" off \ 47 $"Mongolian"
45 $"Maori (Ngai Tahu)" off \ 48 $"Norwegian"
46 $"Maori (Waikoto Uni)" off \ 49 $"Norwegian (Primary)"
47 $"Mongolian" off \ 50 $"Nynorsk"
48 $"Norwegian" off \ 51 $"Polish"
49 $"Norwegian (Primary)" off \ 52 $"Portuguese"
50 $"Nynorsk" off \ 53 $"Portuguese (Brazil)"
51 $"Polish" off \ 54 $"Romanian"
52 $"Portuguese" off \ 55 $"Russian"
53 $"Portuguese (Brazil)" off \ 56 $"Samoan"
54 $"Romanian" off \ 57 $"Serbian"
55 $"Russian" off \ 58 $"Slovak"
56 $"Samoan" off \ 59 $"Slovenian"
57 $"Serbian" off \ 60 $"Somali"
58 $"Slovak" off \ 61 $"Spanish (International)"
59 $"Slovenian" off \ 62 $"Swedish"
60 $"Somali" off \ 63 $"Tagalog"
61 $"Spanish (International)" off \ 64 $"Tamil"
62 $"Swedish" off \ 65 $"Thai"
63 $"Tagalog" off \ 66 $"Turkish"
64 $"Tamil" off \ 67 $"Ukrainian"
65 $"Thai" off \ 68 $"Vietnamese")
66 $"Turkish" off \
67 $"Ukrainian" off \ # shellcheck disable=SC2068
68 $"Vietnamese" off 2> "$data" selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Language" --menu $"Select your language:" 12 60 4 "${W[@]}" 3>&2 2>&1 1>&3)
sel=$?
case $sel in if [ ! "$selection" ]; then
1) rm -f "$data" selection='1'
exit 1;; fi
255) rm -f "$data"
exit 1;; case $selection in
esac 1) DEFAULT_LANGUAGE='en_GB.UTF-8';;
case $(cat "$data") in 2) DEFAULT_LANGUAGE='af_ZA.UTF-8';;
1) DEFAULT_LANGUAGE='af_ZA.UTF-8';; 3) DEFAULT_LANGUAGE='sq_AL.UTF-8';;
2) DEFAULT_LANGUAGE='sq_AL.UTF-8';; 4) DEFAULT_LANGUAGE='ar_SA.UTF-8';;
3) DEFAULT_LANGUAGE='ar_SA.UTF-8';; 5) DEFAULT_LANGUAGE='eu_ES.UTF-8';;
4) DEFAULT_LANGUAGE='eu_ES.UTF-8';; 6) DEFAULT_LANGUAGE='be_BY.UTF-8';;
5) DEFAULT_LANGUAGE='be_BY.UTF-8';; 7) DEFAULT_LANGUAGE='bs_BA.UTF-8';;
6) DEFAULT_LANGUAGE='bs_BA.UTF-8';; 8) DEFAULT_LANGUAGE='bg_BG.UTF-8';;
7) DEFAULT_LANGUAGE='bg_BG.UTF-8';; 9) DEFAULT_LANGUAGE='ca_ES.UTF-8';;
8) DEFAULT_LANGUAGE='ca_ES.UTF-8';; 10) DEFAULT_LANGUAGE='hr_HR.UTF-8';;
9) DEFAULT_LANGUAGE='hr_HR.UTF-8';; 11) DEFAULT_LANGUAGE='zh_CN.UTF-8';;
10) DEFAULT_LANGUAGE='zh_CN.UTF-8';; 12) DEFAULT_LANGUAGE='zh_TW.UTF-8';;
11) DEFAULT_LANGUAGE='zh_TW.UTF-8';; 13) DEFAULT_LANGUAGE='cs_CZ.UTF-8';;
12) DEFAULT_LANGUAGE='cs_CZ.UTF-8';; 14) DEFAULT_LANGUAGE='da_DK.UTF-8';;
13) DEFAULT_LANGUAGE='da_DK.UTF-8';; 15) DEFAULT_LANGUAGE='nl_NL.UTF-8';;
14) DEFAULT_LANGUAGE='nl_NL.UTF-8';;
15) DEFAULT_LANGUAGE='en_GB.UTF-8';;
16) DEFAULT_LANGUAGE='en_US.UTF-8';; 16) DEFAULT_LANGUAGE='en_US.UTF-8';;
17) DEFAULT_LANGUAGE='et_EE.UTF-8';; 17) DEFAULT_LANGUAGE='et_EE.UTF-8';;
18) DEFAULT_LANGUAGE='fa_IR.UTF-8';; 18) DEFAULT_LANGUAGE='fa_IR.UTF-8';;
@ -1033,7 +1030,6 @@ function interactive_select_language {
67) DEFAULT_LANGUAGE='uk_UA.UTF-8';; 67) DEFAULT_LANGUAGE='uk_UA.UTF-8';;
68) DEFAULT_LANGUAGE='vi_VN.UTF-8';; 68) DEFAULT_LANGUAGE='vi_VN.UTF-8';;
esac esac
rm -f "$data"
save_configuration_values save_configuration_values
please_wait please_wait