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

15 lines
288 B
Plaintext
Raw Permalink Normal View History

#!/bin/sh
set -e
if [ -n "${new_host_name}" ]; then
2024-05-07 14:46:59 +00:00
fullname="${new_host_name}"
if [ -n "${new_domain_name}" ]; then
fullname="${fullname}.${new_domain_name}"
fi
cat << EOName > /etc/hostname
2024-05-07 14:46:59 +00:00
${fullname}
EOName
2024-05-07 14:46:59 +00:00
unset fullname
hostname -F /etc/hostname
fi