Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions debian-pkg/opt/tinypilot-privileged/scripts/change-hostname
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ printf "%s\n127.0.1.1 %s\n%s\n%s\n" \
"${MARKER_START}" "${NEW_HOSTNAME}" "${MARKER_END}" "${OLD_ETC_HOSTS}" \
> /etc/hosts

# Populate new hostname to `/etc/hostname`.
# Note that the value must be newline-terminated, see:
# https://manpages.debian.org/stretch/systemd/hostname.5.en.html
printf "%s\n" "${NEW_HOSTNAME}" > /etc/hostname
# We use `hostnamectl set-hostname xyz` instead of `hostnamectl hostname xyz`
# because `set-hostname` is backwards compatible with the Bullseye version of
# `hostnamectl`. `hostnamectl hostname xyz` is only supported on the Bookworm
# version.
hostnamectl set-hostname "${NEW_HOSTNAME}"