#!/bin/zsh
# identity — configure hostname, domain, hostid## Reads /etc/nodename, /etc/defaultdomain, /etc/hostid. All optional —# missing files fall back to system default. Does NOT generate missing# hostid — that's a separate first-boot setup concern out of scope here.set -e
set -u
if[[ -r /etc/nodename ]]; then /bin/hostname "$(cat /etc/nodename)"fi# domainname is NIS-era and isn't shipped on Hammerhead by default.# /etc/defaultdomain is read by getdomainname(3C) directly when needed,# so just leave the file in place; nothing to invoke here.if[[ -r /etc/defaultdomain ]]; then : # /etc/defaultdomain present; getdomainname(3C) reads it directlyfi# hostid is already loaded by the kernel from /etc/hostid; nothing to do# unless we later want to generate it on first boot. Flag for follow-up.exit 0