Optimized hostname procedures

This commit is contained in:
Kevin Veen-Birkenbach 2020-06-12 09:38:13 +02:00
parent b40a3c9696
commit 38d0cc66e5

View File

@ -369,14 +369,17 @@ if [ "$change_password" == "y" ]
info "Skipped password change..." info "Skipped password change..."
fi fi
hostname_path="$root_mount_path""etc/hostname"
question "Should the hostname be changed?(y/N)" && read -r change_hostname question "Should the hostname be changed?(y/N)" && read -r change_hostname
if [ "$change_hostname" == "y" ] if [ "$change_hostname" == "y" ]
then then
question "Type in the hostname:" && read -r hostname; question "Type in the hostname:" && read -r target_hostname;
echo "$hostname" > "$root_mount_path""etc/hostname" || error echo "$target_hostname" > "$hostname_path" || error
else else
target_hostname=$(cat "$hostname_path")
info "Skipped hostname change..." info "Skipped hostname change..."
fi fi
info "Used hostname is: $target_hostname"
question "Should the system be updated?(y/N)" && read -r update_system question "Should the system be updated?(y/N)" && read -r update_system
if [ "$update_system" == "y" ] if [ "$update_system" == "y" ]
@ -422,7 +425,7 @@ if [ "$encrypt_system" == "y" ]
boot_txt_rescue_path="/boot/boot.txt$rescue_suffix" boot_txt_rescue_path="/boot/boot.txt$rescue_suffix"
boot_txt_uncomment_line="part uuid ${devtype} ${devnum}:2 uuid" boot_txt_uncomment_line="part uuid ${devtype} ${devnum}:2 uuid"
boot_txt_setenv_origin="setenv bootargs console=ttyS1,115200 console=tty0 root=PARTUUID=\${uuid} rw rootwait smsc95xx.macaddr=\"\${usbethaddr}\"" boot_txt_setenv_origin="setenv bootargs console=ttyS1,115200 console=tty0 root=PARTUUID=\${uuid} rw rootwait smsc95xx.macaddr=\"\${usbethaddr}\""
boot_txt_setenv_replace="setenv bootargs console=ttyS1,115200 console=tty0 ip=::::pi_rescue:eth0:dhcp cryptdevice=$encrypted_partition_path:root root=$root_mapper_path rw rootwait smsc95xx.macaddr=\"\${usbethaddr}\"" boot_txt_setenv_replace="setenv bootargs console=ttyS1,115200 console=tty0 ip=::::$target_hostname:eth0:dhcp cryptdevice=$encrypted_partition_path:root root=$root_mapper_path rw rootwait smsc95xx.macaddr=\"\${usbethaddr}\""
info "Setup encryption..." && info "Setup encryption..." &&
( (
echo "pacman --noconfirm -S --needed $(get_packages "server/luks")" echo "pacman --noconfirm -S --needed $(get_packages "server/luks")"