05-hostname.sh 245 B

1234567891011
  1. # shellcheck shell=sh
  2. (
  3. [ -r /etc/hostname ] && read -r HOSTNAME < /etc/hostname
  4. [ "${HOSTNAME}" ] && {
  5. msg "setting hostname to '${HOSTNAME}'"
  6. printf '%s' "${HOSTNAME}" > /proc/sys/kernel/hostname \
  7. || error 'failed to set hostname'
  8. }
  9. ) &