}
+#-----------------------------------------------------------
+set_hostname() {
+ echo
+ log "Setting hostname ${hostname} ..."
+ hostnamectl set-hostname --static "${hostname}"
+ hostname > /etc/hostname
+ echo "Hostname normal: $(hostname)"
+ echo "Hostname simple: $(hostname -s)"
+ echo "Hostname FQDN: $(hostname -f)"
+}
+
+#-----------------------------------------------------------
+disable_ipv6() {
+ local sysctl_file="/etc/sysctl.d/99-disable-ipv6.conf"
+ echo
+ log "Disabling IPv6 in '${sysctl_file}' ..."
+ mkdir -pv /etc/sysctl.d
+ echo "#disable ipv6" | tee -a "${sysctl_file}"
+ echo "net.ipv6.conf.all.disable_ipv6 = 1" | tee -a "${sysctl_file}"
+ echo "net.ipv6.conf.default.disable_ipv6 = 1" | tee -a "${sysctl_file}"
+ echo "net.ipv6.conf.lo.disable_ipv6 = 1" | tee -a "${sysctl_file}"
+}
+
#-----------------------------------------------------------
main() {
create_authkeys
import_ssh_hostkeys
create_etc_hosts
+ set_hostname
+ disable_ipv6
}