live-proxmox/live-build/config/includes.chroot_after_packages/etc/dhcp/dhclient-enter-hooks.d/hostname

15 lines
288 B
Bash
Executable File

#!/bin/sh
set -e
if [ -n "${new_host_name}" ]; then
fullname="${new_host_name}"
if [ -n "${new_domain_name}" ]; then
fullname="${fullname}.${new_domain_name}"
fi
cat << EOName > /etc/hostname
${fullname}
EOName
unset fullname
hostname -F /etc/hostname
fi