Steps for essential deps and setup locales

This commit is contained in:
2021-03-05 16:31:31 +00:00
parent 9839cf066a
commit 7d8c3c794f

View File

@@ -5,6 +5,8 @@ toolDownSite="https://raspi.debian.net/tested-images"
toolDownUrl= toolDownUrl=
toolDownFile= toolDownFile=
toolEssentialDeps="vim bash-completion man-db locales wget"
SDDEV= SDDEV=
SDBOOT= SDBOOT=
SDBOOTPUUID= SDBOOTPUUID=
@@ -99,26 +101,20 @@ step_3() {
cat <<PREPARE_EOF cat <<PREPARE_EOF
[I] Setup static IP [I] Setup static IP
[etc/network/interfaces.d/eth0] [etc/network/interfaces.d/eth0]
#iface eth0 inet dhcp #iface eth0 inet dhcp
iface eth0 inet static iface eth0 inet static
address 192.168.23.38/24 address 192.168.0.38/24
gateway 192.168.23.1 gateway 192.168.0.1
dns-nameserver 192.168.23.20
dns-search lan
iface eth0 inet6 static iface eth0 inet6 static
address fd23::38/72 address fd00::38/72
gateway fd23::cece:1eff:fea5:433d/64 gateway fd00::1/64
dns-nameserver fd23::20/72
dns-search lan
[I] Setup dns nameserver [I] Setup dns nameserver
[etc/resolv.conf] [etc/resolv.conf]
nameserver 192.168.0.1
nameserver 192.168.23.20 nameserver fd00::1
nameserver fd23::20
[I] Setup root ssh access [I] Setup root ssh access
[etc/ssh/sshd_config] [etc/ssh/sshd_config]
@@ -133,11 +129,34 @@ PREPARE_EOF
step_10_info() { echo "Essential debian setup"; } step_10_info() { echo "Essential debian setup"; }
step_10_alias() { ALIAS="setup"; } step_10_alias() { ALIAS="setup"; }
step_10() { step_10() {
if [[ "$(uname)" =~ .*Rasp.* ]] ; then if [ -z "$(ls /etc/default | grep raspi)" ] ; then
echo Raspi echoerr " [E] Not on a Raspberry pi"
return -1
fi fi
exe apt update
exe apt full-upgrade
exe apt install $toolEssentialDeps
} }
step_11_info() { echo "Setup locales to en_US.UTF-8"; }
step_11() {
local localUs="en_US.UTF-8"
local localUsDefault"$localUs UTF-8"
if [ ! -f "$localesConfigLoc" ] ; then
echoerr " [E] Install packages locales first"
exit -1
fi
exe sed -i "s/#[[:space:]]*\($localUsDefault\)/\1/" "$localesConfigLoc"
endReturn -o $? "Changing locales failed"
exe locale-gen
exe update-locale LANG=$localUs
echoseq " [I] Logout and login for changes to be active"
}
localesConfigLoc="/etc/locale.gen"
read_sd_dev() { read_sd_dev() {
local partExt="" local partExt=""
if [ ! -z "$1" ] ; then if [ ! -z "$1" ] ; then