Minimise the number of decisions during interactive install
This commit is contained in:
parent
79f5759a08
commit
3987268027
Binary file not shown.
Binary file not shown.
|
@ -53,6 +53,9 @@ INSTALLING_ON_BBB="no"
|
|||
# Version number of this script
|
||||
VERSION="1.01"
|
||||
|
||||
# if yes then this minimises the number of descisions presented during install
|
||||
MINIMAL_INSTALL="yes"
|
||||
|
||||
# Different system variants which may be specified within
|
||||
# the SYSTEM_TYPE option
|
||||
VARIANT_FULL="full"
|
||||
|
@ -473,6 +476,7 @@ function show_help {
|
|||
echo ''
|
||||
echo $' -h --help Show help'
|
||||
echo $' menuconfig Easy interactive installation'
|
||||
echo $' menuconfigfull Full interactive installation'
|
||||
echo $' -c --config Installing from a configuration file'
|
||||
echo $' --bbb Installing on Beaglebone Black'
|
||||
echo $' -u --user User to install the system as'
|
||||
|
@ -561,11 +565,20 @@ function interactive_configuration {
|
|||
rm -f /tmp/meshuserdevice
|
||||
fi
|
||||
|
||||
freedombone-config \
|
||||
-f $CONFIGURATION_FILE \
|
||||
-w $FREEDOMBONE_WEBSITE \
|
||||
-b $FREEDOMBONE_BITMESSAGE \
|
||||
-m $MINIMUM_PASSWORD_LENGTH
|
||||
if [[ $MINIMAL_INSTALL == "no" ]]; then
|
||||
freedombone-config \
|
||||
-f $CONFIGURATION_FILE \
|
||||
-w $FREEDOMBONE_WEBSITE \
|
||||
-b $FREEDOMBONE_BITMESSAGE \
|
||||
-m $MINIMUM_PASSWORD_LENGTH
|
||||
else
|
||||
freedombone-config \
|
||||
-f $CONFIGURATION_FILE \
|
||||
-w $FREEDOMBONE_WEBSITE \
|
||||
-b $FREEDOMBONE_BITMESSAGE \
|
||||
-m $MINIMUM_PASSWORD_LENGTH
|
||||
--minimal "yes"
|
||||
fi
|
||||
if [ -f /tmp/meshuserdevice ]; then
|
||||
# mesh network user device installation
|
||||
rm -f /tmp/meshuserdevice
|
||||
|
@ -574,7 +587,7 @@ function interactive_configuration {
|
|||
if [ ! "$?" = "0" ]; then
|
||||
echo 'Command failed:'
|
||||
echo ''
|
||||
echo " freedombone-config -u $MY_USERNAME -f $CONFIGURATION_FILE -w $FREEDOMBONE_WEBSITE -b $FREEDOMBONE_BITMESSAGE -m $MINIMUM_PASSWORD_LENGTH"
|
||||
echo " freedombone-config -u $MY_USERNAME -f $CONFIGURATION_FILE -w $FREEDOMBONE_WEBSITE -b $FREEDOMBONE_BITMESSAGE -m $MINIMUM_PASSWORD_LENGTH --minimal [yes|no]"
|
||||
echo ''
|
||||
exit 73594
|
||||
fi
|
||||
|
@ -593,7 +606,14 @@ function interactive_configuration {
|
|||
fi
|
||||
}
|
||||
|
||||
if [[ $1 == "menuconfig" ]]; then
|
||||
command_options=$1
|
||||
|
||||
if [[ $command_options == "menuconfigfull" ]]; then
|
||||
MINIMAL_INSTALL="no"
|
||||
command_options="menuconfig"
|
||||
fi
|
||||
|
||||
if [[ $command_options == "menuconfig" ]]; then
|
||||
interactive_configuration
|
||||
else
|
||||
while [[ $# > 1 ]]
|
||||
|
@ -760,6 +780,11 @@ else
|
|||
shift
|
||||
DEBIAN_REPO=$1
|
||||
;;
|
||||
# minimal install
|
||||
--minimal)
|
||||
shift
|
||||
MINIMAL_INSTALL=$1
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
;;
|
||||
|
@ -830,7 +855,9 @@ function read_configuration {
|
|||
if [[ $CONFIGURATION_FILE != '/root/freedombone.cfg' ]]; then
|
||||
cp $CONFIGURATION_FILE /root/freedombone.cfg
|
||||
fi
|
||||
|
||||
if grep -q "MINIMAL_INSTALL" $CONFIGURATION_FILE; then
|
||||
MINIMAL_INSTALL=$(grep "MINIMAL_INSTALL" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
||||
fi
|
||||
if grep -q "LETSENCRYPT_SERVER" $CONFIGURATION_FILE; then
|
||||
LETSENCRYPT_SERVER=$(grep "LETSENCRYPT_SERVER" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
||||
fi
|
||||
|
|
|
@ -70,7 +70,7 @@ DEFAULT_DOMAIN_NAME=
|
|||
DEFAULT_DOMAIN_CODE=
|
||||
MY_EMAIL_ADDRESS=
|
||||
SYSTEM_TYPE=
|
||||
INSTALLING_ON_BBB=
|
||||
INSTALLING_ON_BBB="no"
|
||||
DDNS_PROVIDER=
|
||||
DDNS_USERNAME=
|
||||
DDNS_PASSWORD=
|
||||
|
@ -107,6 +107,7 @@ BATMAN_CELLID='any'
|
|||
WIFI_CHANNEL=
|
||||
CONFIGURATION_FILE=
|
||||
DH_KEYLENGTH=
|
||||
MINIMAL_INSTALL="no"
|
||||
|
||||
function show_help {
|
||||
echo ''
|
||||
|
@ -120,6 +121,7 @@ function show_help {
|
|||
echo $' -m --min Minimum password length (characters)'
|
||||
echo $' -w --www Freedombone web site'
|
||||
echo $' -b --bm Freedombone support Bitmessage address'
|
||||
echo $' --minimal [yes|no] For minimalistic "consumer grade" installs'
|
||||
echo ''
|
||||
exit 0
|
||||
}
|
||||
|
@ -153,6 +155,10 @@ do
|
|||
shift
|
||||
FREEDOMBONE_BITMESSAGE="$1"
|
||||
;;
|
||||
--minimal)
|
||||
shift
|
||||
MINIMAL_INSTALL="$1"
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
;;
|
||||
|
@ -731,269 +737,288 @@ function interactive_configuration {
|
|||
fi
|
||||
save_configuration_file
|
||||
|
||||
if [[ $(grep "INSTALLING_ON_BBB" temp.cfg | awk -F '=' '{print $2}') == "yes" ]]; then
|
||||
dialog --title $"Install Target" \
|
||||
--backtitle $"Freedombone Configuration" \
|
||||
--yesno $"\nAre you installing onto a Beaglebone Black?" 7 60
|
||||
else
|
||||
dialog --title $"Install Target" \
|
||||
--backtitle $"Freedombone Configuration" \
|
||||
--defaultno \
|
||||
--yesno $"\nAre you installing onto a Beaglebone Black?" 7 60
|
||||
fi
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) INSTALLING_ON_BBB="yes";;
|
||||
1) INSTALLING_ON_BBB="no";;
|
||||
255) exit 1;;
|
||||
esac
|
||||
if [[ $INSTALLING_ON_BBB == "yes" ]]; then
|
||||
USB_DRIVE=/dev/sda1
|
||||
# here a short diffie-hellman key length is used, because otherwise creation of keys
|
||||
# becomes impractically long on the beaglebone. It is known (as of 2015) that
|
||||
# 1024bit DH may be breakable, so this is really a tradeoff between security and the
|
||||
# available hardware
|
||||
DH_KEYLENGTH=1024
|
||||
fi
|
||||
save_configuration_file
|
||||
|
||||
if [[ $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then
|
||||
interactive_gpg
|
||||
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
SOCIAL_KEY_STR=$"\nDo you wish to enable social key management, otherwise known as \"the unforgettable key\"?\n\nThis means that fragments of your GPG key will be included with any remote backups so that if you later lose your key then it can be reconstructed from your friends servers. If you select \"no\" then you can still do social key management, but offline using physical USB thumb drives, which is more secure but less convenient."
|
||||
if [[ $(grep "ENABLE_SOCIAL_KEY_MANAGEMENT" temp.cfg | awk -F '=' '{print $2}') == "yes" ]]; then
|
||||
dialog --title $"Social Key Management" \
|
||||
if [[ $MINIMAL_INSTALL == "no" ]]; then
|
||||
if [[ $(grep "INSTALLING_ON_BBB" temp.cfg | awk -F '=' '{print $2}') == "yes" ]]; then
|
||||
dialog --title $"Install Target" \
|
||||
--backtitle $"Freedombone Configuration" \
|
||||
--yesno "$SOCIAL_KEY_STR" 15 60
|
||||
--yesno $"\nAre you installing onto a Beaglebone Black?" 7 60
|
||||
else
|
||||
dialog --title $"Social Key Management" \
|
||||
dialog --title $"Install Target" \
|
||||
--backtitle $"Freedombone Configuration" \
|
||||
--defaultno \
|
||||
--yesno "$SOCIAL_KEY_STR" 15 60
|
||||
--yesno $"\nAre you installing onto a Beaglebone Black?" 7 60
|
||||
fi
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) ENABLE_SOCIAL_KEY_MANAGEMENT="yes";;
|
||||
0) INSTALLING_ON_BBB="yes";;
|
||||
1) INSTALLING_ON_BBB="no";;
|
||||
255) exit 1;;
|
||||
esac
|
||||
if [[ $INSTALLING_ON_BBB == "yes" ]]; then
|
||||
USB_DRIVE=/dev/sda1
|
||||
# here a short diffie-hellman key length is used, because otherwise creation of keys
|
||||
# becomes impractically long on the beaglebone. It is known (as of 2015) that
|
||||
# 1024bit DH may be breakable, so this is really a tradeoff between security and the
|
||||
# available hardware
|
||||
DH_KEYLENGTH=1024
|
||||
fi
|
||||
save_configuration_file
|
||||
fi
|
||||
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
if [[ $INSTALLING_ON_BBB != "yes" ]]; then
|
||||
if [[ $MINIMAL_INSTALL == "no" ]]; then
|
||||
if [[ $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then
|
||||
interactive_gpg
|
||||
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
SOCIAL_KEY_STR=$"\nDo you wish to enable social key management, otherwise known as \"the unforgettable key\"?\n\nThis means that fragments of your GPG key will be included with any remote backups so that if you later lose your key then it can be reconstructed from your friends servers. If you select \"no\" then you can still do social key management, but offline using physical USB thumb drives, which is more secure but less convenient."
|
||||
if [[ $(grep "ENABLE_SOCIAL_KEY_MANAGEMENT" temp.cfg | awk -F '=' '{print $2}') == "yes" ]]; then
|
||||
dialog --title $"Social Key Management" \
|
||||
--backtitle $"Freedombone Configuration" \
|
||||
--yesno "$SOCIAL_KEY_STR" 15 60
|
||||
else
|
||||
dialog --title $"Social Key Management" \
|
||||
--backtitle $"Freedombone Configuration" \
|
||||
--defaultno \
|
||||
--yesno "$SOCIAL_KEY_STR" 15 60
|
||||
fi
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) ENABLE_SOCIAL_KEY_MANAGEMENT="yes";;
|
||||
255) exit 1;;
|
||||
esac
|
||||
save_configuration_file
|
||||
fi
|
||||
else
|
||||
# enable for the minimal case
|
||||
ENABLE_SOCIAL_KEY_MANAGEMENT="yes"
|
||||
fi
|
||||
|
||||
if [[ $MINIMAL_INSTALL == "no" ]]; then
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
if [[ $INSTALLING_ON_BBB != "yes" ]]; then
|
||||
dialog --backtitle $"Freedombone Configuration" \
|
||||
--radiolist $"Type of Random Number Generator:" 10 40 2 \
|
||||
1 Haveged on \
|
||||
2 OneRNG off 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
1) exit 1;;
|
||||
255) exit 1;;
|
||||
esac
|
||||
case $(cat $data) in
|
||||
2) HWRNG_TYPE="onerng"
|
||||
dialog --title $"OneRNG Device" \
|
||||
--msgbox $"Please ensure that the OneRNG device is disconnected. You can reconnect it later during the installation" 8 60
|
||||
;;
|
||||
255) exit 1;;
|
||||
esac
|
||||
else
|
||||
HWRNG_TYPE="beaglebone"
|
||||
fi
|
||||
save_configuration_file
|
||||
fi
|
||||
|
||||
if [[ $MINIMAL_INSTALL == "no" ]]; then
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
dialog --backtitle $"Freedombone Configuration" \
|
||||
--radiolist $"Type of Random Number Generator:" 10 40 2 \
|
||||
1 Haveged on \
|
||||
2 OneRNG off 2> $data
|
||||
--radiolist $"Where to download Debian packages from:" 25 45 49 \
|
||||
1 $"Australia" off \
|
||||
2 $"Austria" off \
|
||||
3 $"Belarus" off \
|
||||
4 $"Belgium" off \
|
||||
5 $"Bosnia and Herzegovina" off \
|
||||
6 $"Brazil" off \
|
||||
7 $"Bulgaria" off \
|
||||
8 $"Canada" off \
|
||||
9 $"Chile" off \
|
||||
10 $"China" off \
|
||||
11 $"Croatia" off \
|
||||
12 $"Czech Republic" off \
|
||||
13 $"Denmark" off \
|
||||
14 $"El Salvador" off \
|
||||
15 $"Estonia" off \
|
||||
16 $"Finland" off \
|
||||
17 $"France 1" off \
|
||||
18 $"France 2" off \
|
||||
19 $"Germany 1" off \
|
||||
20 $"Germany 2" off \
|
||||
21 $"Greece" off \
|
||||
22 $"Hungary" off \
|
||||
23 $"Iceland" off \
|
||||
24 $"Iran" off \
|
||||
25 $"Ireland" off \
|
||||
26 $"Italy" off \
|
||||
27 $"Japan" off \
|
||||
28 $"Korea" off \
|
||||
29 $"Lithuania" off \
|
||||
30 $"Mexico" off \
|
||||
31 $"Netherlands" off \
|
||||
32 $"New Caledonia" off \
|
||||
33 $"New Zealand" off \
|
||||
34 $"Norway" off \
|
||||
35 $"Poland" off \
|
||||
36 $"Portugal" off \
|
||||
37 $"Romania" off \
|
||||
38 $"Russia" off \
|
||||
39 $"Slovakia" off \
|
||||
40 $"Slovenia" off \
|
||||
41 $"Spain" off \
|
||||
42 $"Sweden" off \
|
||||
43 $"Switzerland" off \
|
||||
44 $"Taiwan" off \
|
||||
45 $"Thailand" off \
|
||||
46 $"Turkey" off \
|
||||
47 $"Ukraine" off \
|
||||
48 $"United Kingdom" off \
|
||||
49 $"United States" on 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
1) exit 1;;
|
||||
255) exit 1;;
|
||||
esac
|
||||
case $(cat $data) in
|
||||
2) HWRNG_TYPE="onerng"
|
||||
dialog --title $"OneRNG Device" \
|
||||
--msgbox $"Please ensure that the OneRNG device is disconnected. You can reconnect it later during the installation" 8 60
|
||||
;;
|
||||
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) exit 1;;
|
||||
esac
|
||||
save_configuration_file
|
||||
else
|
||||
HWRNG_TYPE="beaglebone"
|
||||
DEBIAN_REPO='ftp.de.debian.org'
|
||||
fi
|
||||
save_configuration_file
|
||||
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
dialog --backtitle $"Freedombone Configuration" \
|
||||
--radiolist $"Where to download Debian packages from:" 25 45 49 \
|
||||
1 $"Australia" off \
|
||||
2 $"Austria" off \
|
||||
3 $"Belarus" off \
|
||||
4 $"Belgium" off \
|
||||
5 $"Bosnia and Herzegovina" off \
|
||||
6 $"Brazil" off \
|
||||
7 $"Bulgaria" off \
|
||||
8 $"Canada" off \
|
||||
9 $"Chile" off \
|
||||
10 $"China" off \
|
||||
11 $"Croatia" off \
|
||||
12 $"Czech Republic" off \
|
||||
13 $"Denmark" off \
|
||||
14 $"El Salvador" off \
|
||||
15 $"Estonia" off \
|
||||
16 $"Finland" off \
|
||||
17 $"France 1" off \
|
||||
18 $"France 2" off \
|
||||
19 $"Germany 1" off \
|
||||
20 $"Germany 2" off \
|
||||
21 $"Greece" off \
|
||||
22 $"Hungary" off \
|
||||
23 $"Iceland" off \
|
||||
24 $"Iran" off \
|
||||
25 $"Ireland" off \
|
||||
26 $"Italy" off \
|
||||
27 $"Japan" off \
|
||||
28 $"Korea" off \
|
||||
29 $"Lithuania" off \
|
||||
30 $"Mexico" off \
|
||||
31 $"Netherlands" off \
|
||||
32 $"New Caledonia" off \
|
||||
33 $"New Zealand" off \
|
||||
34 $"Norway" off \
|
||||
35 $"Poland" off \
|
||||
36 $"Portugal" off \
|
||||
37 $"Romania" off \
|
||||
38 $"Russia" off \
|
||||
39 $"Slovakia" off \
|
||||
40 $"Slovenia" off \
|
||||
41 $"Spain" off \
|
||||
42 $"Sweden" off \
|
||||
43 $"Switzerland" off \
|
||||
44 $"Taiwan" off \
|
||||
45 $"Thailand" off \
|
||||
46 $"Turkey" off \
|
||||
47 $"Ukraine" off \
|
||||
48 $"United Kingdom" off \
|
||||
49 $"United States" on 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
1) exit 1;;
|
||||
255) exit 1;;
|
||||
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) exit 1;;
|
||||
esac
|
||||
save_configuration_file
|
||||
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
dialog --backtitle $"Freedombone Configuration" \
|
||||
--radiolist $"Pick a domain name service (DNS):" 25 50 16 \
|
||||
1 $"Digital Courage" on \
|
||||
2 $"German Privacy Foundation 1" off \
|
||||
3 $"German Privacy Foundation 2" off \
|
||||
4 $"Chaos Computer Club" off \
|
||||
5 $"ClaraNet" off \
|
||||
6 $"OpenNIC 1" off \
|
||||
7 $"OpenNIC 2" off \
|
||||
8 $"OpenNIC 3" off \
|
||||
9 $"OpenNIC 4" off \
|
||||
10 $"OpenNIC 5" off \
|
||||
11 $"OpenNIC 6" off \
|
||||
12 $"OpenNIC 7" off \
|
||||
13 $"PowerNS" off \
|
||||
14 $"ValiDOM" off \
|
||||
15 $"Freie Unzensierte" off \
|
||||
16 $"Google" off 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
1) exit 1;;
|
||||
255) exit 1;;
|
||||
esac
|
||||
case $(cat $data) in
|
||||
1) NAMESERVER1='85.214.73.63'
|
||||
NAMESERVER2='213.73.91.35'
|
||||
;;
|
||||
2) NAMESERVER1='87.118.100.175'
|
||||
NAMESERVER2='94.75.228.29'
|
||||
;;
|
||||
3) NAMESERVER1='85.25.251.254'
|
||||
NAMESERVER2='2.141.58.13'
|
||||
;;
|
||||
4) NAMESERVER1='213.73.91.35'
|
||||
NAMESERVER2='85.214.73.63'
|
||||
;;
|
||||
5) NAMESERVER1='212.82.225.7'
|
||||
NAMESERVER2='212.82.226.212'
|
||||
;;
|
||||
6) NAMESERVER1='58.6.115.42'
|
||||
NAMESERVER2='58.6.115.43'
|
||||
;;
|
||||
7) NAMESERVER1='119.31.230.42'
|
||||
NAMESERVER2='200.252.98.162'
|
||||
;;
|
||||
8) NAMESERVER1='217.79.186.148'
|
||||
NAMESERVER2='81.89.98.6'
|
||||
;;
|
||||
9) NAMESERVER1='78.159.101.37'
|
||||
NAMESERVER2='203.167.220.153'
|
||||
;;
|
||||
10) NAMESERVER1='82.229.244.191'
|
||||
NAMESERVER2='82.229.244.191'
|
||||
;;
|
||||
11) NAMESERVER1='216.87.84.211'
|
||||
NAMESERVER2='66.244.95.20'
|
||||
;;
|
||||
12) NAMESERVER1='207.192.69.155'
|
||||
NAMESERVER2='72.14.189.120'
|
||||
;;
|
||||
13) NAMESERVER1='194.145.226.26'
|
||||
NAMESERVER2='77.220.232.44'
|
||||
;;
|
||||
14) NAMESERVER1='78.46.89.147'
|
||||
NAMESERVER2='88.198.75.145'
|
||||
;;
|
||||
15) NAMESERVER1='85.25.149.144'
|
||||
NAMESERVER2='87.106.37.196'
|
||||
;;
|
||||
16) NAMESERVER1='8.8.8.8'
|
||||
NAMESERVER2='4.4.4.4'
|
||||
;;
|
||||
255) exit 1;;
|
||||
esac
|
||||
save_configuration_file
|
||||
if [[ $MINIMAL_INSTALL == "no" ]]; then
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
dialog --backtitle $"Freedombone Configuration" \
|
||||
--radiolist $"Pick a domain name service (DNS):" 25 50 16 \
|
||||
1 $"Digital Courage" on \
|
||||
2 $"German Privacy Foundation 1" off \
|
||||
3 $"German Privacy Foundation 2" off \
|
||||
4 $"Chaos Computer Club" off \
|
||||
5 $"ClaraNet" off \
|
||||
6 $"OpenNIC 1" off \
|
||||
7 $"OpenNIC 2" off \
|
||||
8 $"OpenNIC 3" off \
|
||||
9 $"OpenNIC 4" off \
|
||||
10 $"OpenNIC 5" off \
|
||||
11 $"OpenNIC 6" off \
|
||||
12 $"OpenNIC 7" off \
|
||||
13 $"PowerNS" off \
|
||||
14 $"ValiDOM" off \
|
||||
15 $"Freie Unzensierte" off \
|
||||
16 $"Google" off 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
1) exit 1;;
|
||||
255) exit 1;;
|
||||
esac
|
||||
case $(cat $data) in
|
||||
1) NAMESERVER1='85.214.73.63'
|
||||
NAMESERVER2='213.73.91.35'
|
||||
;;
|
||||
2) NAMESERVER1='87.118.100.175'
|
||||
NAMESERVER2='94.75.228.29'
|
||||
;;
|
||||
3) NAMESERVER1='85.25.251.254'
|
||||
NAMESERVER2='2.141.58.13'
|
||||
;;
|
||||
4) NAMESERVER1='213.73.91.35'
|
||||
NAMESERVER2='85.214.73.63'
|
||||
;;
|
||||
5) NAMESERVER1='212.82.225.7'
|
||||
NAMESERVER2='212.82.226.212'
|
||||
;;
|
||||
6) NAMESERVER1='58.6.115.42'
|
||||
NAMESERVER2='58.6.115.43'
|
||||
;;
|
||||
7) NAMESERVER1='119.31.230.42'
|
||||
NAMESERVER2='200.252.98.162'
|
||||
;;
|
||||
8) NAMESERVER1='217.79.186.148'
|
||||
NAMESERVER2='81.89.98.6'
|
||||
;;
|
||||
9) NAMESERVER1='78.159.101.37'
|
||||
NAMESERVER2='203.167.220.153'
|
||||
;;
|
||||
10) NAMESERVER1='82.229.244.191'
|
||||
NAMESERVER2='82.229.244.191'
|
||||
;;
|
||||
11) NAMESERVER1='216.87.84.211'
|
||||
NAMESERVER2='66.244.95.20'
|
||||
;;
|
||||
12) NAMESERVER1='207.192.69.155'
|
||||
NAMESERVER2='72.14.189.120'
|
||||
;;
|
||||
13) NAMESERVER1='194.145.226.26'
|
||||
NAMESERVER2='77.220.232.44'
|
||||
;;
|
||||
14) NAMESERVER1='78.46.89.147'
|
||||
NAMESERVER2='88.198.75.145'
|
||||
;;
|
||||
15) NAMESERVER1='85.25.149.144'
|
||||
NAMESERVER2='87.106.37.196'
|
||||
;;
|
||||
16) NAMESERVER1='8.8.8.8'
|
||||
NAMESERVER2='4.4.4.4'
|
||||
;;
|
||||
255) exit 1;;
|
||||
esac
|
||||
save_configuration_file
|
||||
else
|
||||
# as defaults for a minimal install process these settings are debatable
|
||||
NAMESERVER1='85.214.73.63'
|
||||
NAMESERVER2='213.73.91.35'
|
||||
fi
|
||||
|
||||
if [[ $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then
|
||||
|
||||
|
@ -1093,46 +1118,48 @@ function interactive_configuration {
|
|||
save_configuration_file
|
||||
fi
|
||||
|
||||
SET_STATIC_IP="no"
|
||||
dialog --title $"Static local IP address" \
|
||||
--backtitle $"Freedombone Configuration" \
|
||||
--defaultno \
|
||||
--yesno $"\nDo you want to set a static local IP address for this system?\n\nFor example, 192.168.1.10" 10 60
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) SET_STATIC_IP="yes";;
|
||||
255) exit 1;;
|
||||
esac
|
||||
|
||||
if [[ $SET_STATIC_IP == "yes" ]]; then
|
||||
if [ ! $LOCAL_NETWORK_STATIC_IP_ADDRESS ]; then
|
||||
LOCAL_NETWORK_STATIC_IP_ADDRESS=$(grep 'LOCAL_NETWORK_STATIC_IP_ADDRESS' temp.cfg | awk -F '=' '{print $2}')
|
||||
if [ ! $LOCAL_NETWORK_STATIC_IP_ADDRESS ]; then
|
||||
LOCAL_NETWORK_STATIC_IP_ADDRESS='192.168..'
|
||||
fi
|
||||
fi
|
||||
if [ ! $ROUTER_IP_ADDRESS ]; then
|
||||
ROUTER_IP_ADDRESS=$(grep 'ROUTER_IP_ADDRESS' temp.cfg | awk -F '=' '{print $2}')
|
||||
if [ ! $ROUTER_IP_ADDRESS ]; then
|
||||
ROUTER_IP_ADDRESS='192.168..'
|
||||
fi
|
||||
fi
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
dialog --backtitle $"Freedombone Configuration" \
|
||||
--title $"Local Network Configuration" \
|
||||
--form $"\nPlease enter the IP addresses:" 11 55 3 \
|
||||
$"This system:" 1 1 "$LOCAL_NETWORK_STATIC_IP_ADDRESS" 1 16 16 15 \
|
||||
$"Internet router:" 2 1 "$ROUTER_IP_ADDRESS" 2 16 16 15 \
|
||||
2> $data
|
||||
if [[ $MINIMAL_INSTALL == "no" ]]; then
|
||||
SET_STATIC_IP="no"
|
||||
dialog --title $"Static local IP address" \
|
||||
--backtitle $"Freedombone Configuration" \
|
||||
--defaultno \
|
||||
--yesno $"\nDo you want to set a static local IP address for this system?\n\nFor example, 192.168.1.10" 10 60
|
||||
sel=$?
|
||||
case $sel in
|
||||
1) exit 1;;
|
||||
0) SET_STATIC_IP="yes";;
|
||||
255) exit 1;;
|
||||
esac
|
||||
LOCAL_NETWORK_STATIC_IP_ADDRESS=$(cat $data | sed -n 1p)
|
||||
ROUTER_IP_ADDRESS=$(cat $data | sed -n 2p)
|
||||
save_configuration_file
|
||||
|
||||
if [[ $SET_STATIC_IP == "yes" ]]; then
|
||||
if [ ! $LOCAL_NETWORK_STATIC_IP_ADDRESS ]; then
|
||||
LOCAL_NETWORK_STATIC_IP_ADDRESS=$(grep 'LOCAL_NETWORK_STATIC_IP_ADDRESS' temp.cfg | awk -F '=' '{print $2}')
|
||||
if [ ! $LOCAL_NETWORK_STATIC_IP_ADDRESS ]; then
|
||||
LOCAL_NETWORK_STATIC_IP_ADDRESS='192.168..'
|
||||
fi
|
||||
fi
|
||||
if [ ! $ROUTER_IP_ADDRESS ]; then
|
||||
ROUTER_IP_ADDRESS=$(grep 'ROUTER_IP_ADDRESS' temp.cfg | awk -F '=' '{print $2}')
|
||||
if [ ! $ROUTER_IP_ADDRESS ]; then
|
||||
ROUTER_IP_ADDRESS='192.168..'
|
||||
fi
|
||||
fi
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
dialog --backtitle $"Freedombone Configuration" \
|
||||
--title $"Local Network Configuration" \
|
||||
--form $"\nPlease enter the IP addresses:" 11 55 3 \
|
||||
$"This system:" 1 1 "$LOCAL_NETWORK_STATIC_IP_ADDRESS" 1 16 16 15 \
|
||||
$"Internet router:" 2 1 "$ROUTER_IP_ADDRESS" 2 16 16 15 \
|
||||
2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
1) exit 1;;
|
||||
255) exit 1;;
|
||||
esac
|
||||
LOCAL_NETWORK_STATIC_IP_ADDRESS=$(cat $data | sed -n 1p)
|
||||
ROUTER_IP_ADDRESS=$(cat $data | sed -n 2p)
|
||||
save_configuration_file
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
|
||||
|
@ -1453,7 +1480,7 @@ function interactive_configuration {
|
|||
trap "rm -f $data" 0 1 2 5 15
|
||||
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
||||
dialog --backtitle $"Freedombone Configuration" \
|
||||
--title $"Default Domain" \
|
||||
--title $"Your main domain name" \
|
||||
--form $"\nWhich domain name should your email/XMPP/IRC/VoIP be associated with?" 11 55 3 \
|
||||
$"Domain:" 1 1 "$(grep 'DEFAULT_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 16 25 30 \
|
||||
$"Code:" 2 1 "$(grep 'DEFAULT_DOMAIN_CODE' temp.cfg | awk -F '=' '{print $2}')" 2 16 25 30 \
|
||||
|
|
|
@ -76,6 +76,9 @@ INTERACTIVE="no"
|
|||
# Whether this is a generic image for mass redistribution on the interwebs
|
||||
GENERIC_IMAGE="no"
|
||||
|
||||
# Whether to reduce the number of decisions during interactive install
|
||||
MINIMAL_INSTALL="yes"
|
||||
|
||||
while [[ $# > 1 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
@ -145,6 +148,10 @@ case $key in
|
|||
shift
|
||||
GENERIC_IMAGE="$1"
|
||||
;;
|
||||
--minimal)
|
||||
shift
|
||||
MINIMAL_INSTALL="$1"
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
;;
|
||||
|
@ -153,7 +160,7 @@ shift
|
|||
done
|
||||
|
||||
if [[ $INTERACTIVE == "yes" || $INTERACTIVE == "y" || $INTERACTIVE == "Yes" ]]; then
|
||||
freedombone-config
|
||||
freedombone-config --minimal "$MINIMAL_INSTALL"
|
||||
if [ -f freedombone.cfg ]; then
|
||||
CONFIG_FILENAME=freedombone.cfg
|
||||
DEFAULT_DOMAIN_NAME=$(cat $CONFIG_FILENAME | grep 'DEFAULT_DOMAIN_NAME' | awk -F '=' '{print $2}')
|
||||
|
@ -207,7 +214,8 @@ make $IMAGE_TYPE \
|
|||
CONFIG_FILENAME="$CONFIG_FILENAME" \
|
||||
IMAGE_SIZE="$IMAGE_SIZE" \
|
||||
SSH_PUBKEY="$SSH_PUBKEY" \
|
||||
GENERIC_IMAGE="$GENERIC_IMAGE"
|
||||
GENERIC_IMAGE="$GENERIC_IMAGE" \
|
||||
MINIMAL_INSTALL="$MINIMAL_INSTALL"
|
||||
|
||||
if [ ! "$?" = "0" ]; then
|
||||
echo $'Build failed'
|
||||
|
|
|
@ -34,6 +34,9 @@ PROJECT_NAME='freedombone'
|
|||
export TEXTDOMAIN=${PROJECT_NAME}-image-customise
|
||||
export TEXTDOMAINDIR="/usr/share/locale"
|
||||
|
||||
# Whether to minimise the number of decisions during interactive install
|
||||
MINIMAL_INSTALL="yes"
|
||||
|
||||
MY_USERNAME='debian'
|
||||
MY_PASSWORD='freedombone'
|
||||
|
||||
|
@ -255,7 +258,11 @@ EOF
|
|||
echo -n " echo \"${MY_USERNAME}:" >> $rootdir/root/.bashrc
|
||||
echo '$(printf `cat ~/login.txt`)"|chpasswd' >> $rootdir/root/.bashrc
|
||||
|
||||
echo ' freedombone menuconfig' >> $rootdir/root/.bashrc
|
||||
if [[ $MINIMAL_INSTALL == "no" ]]; then
|
||||
echo ' freedombone menuconfigfull' >> $rootdir/root/.bashrc
|
||||
else
|
||||
echo ' freedombone menuconfig' >> $rootdir/root/.bashrc
|
||||
fi
|
||||
echo ' if [ "$?" = "0" ]; then' >> $rootdir/root/.bashrc
|
||||
echo ' if [ -f ~/freedombone-completed.txt ]; then' >> $rootdir/root/.bashrc
|
||||
# Remove the initial setup files
|
||||
|
|
|
@ -51,6 +51,7 @@ export PROJECT_NAME
|
|||
export CONFIG_FILENAME
|
||||
export SSH_PUBKEY
|
||||
export GENERIC_IMAGE
|
||||
export MINIMAL_INSTALL
|
||||
|
||||
# Locate vmdebootstrap program fetched in Makefile
|
||||
basedir=`pwd`
|
||||
|
@ -162,6 +163,7 @@ sudo sed -i "s|PROJECT_NAME=.*|PROJECT_NAME=${PROJECT_NAME}|g" $TEMP_CUSTOMISE
|
|||
sudo sed -i "s|CONFIG_FILENAME=.*|CONFIG_FILENAME=${CONFIG_FILENAME}|g" $TEMP_CUSTOMISE
|
||||
sudo sed -i "s|SSH_PUBKEY=.*|SSH_PUBKEY=${SSH_PUBKEY}|g" $TEMP_CUSTOMISE
|
||||
sudo sed -i "s|GENERIC_IMAGE=.*|GENERIC_IMAGE=${GENERIC_IMAGE}|g" $TEMP_CUSTOMISE
|
||||
sudo sed -i "s|MINIMAL_INSTALL=.*|MINIMAL_INSTALL=\"${MINIMAL_INSTALL}\"|g" $TEMP_CUSTOMISE
|
||||
|
||||
echo $"starting $VMDEBOOTSTRAP"
|
||||
# Run vmdebootstrap script to create image
|
||||
|
|
Loading…
Reference in New Issue