Skip to content

Commit

Permalink
fix issue with fallback hostname defaulting to "thinroot" and not using
Browse files Browse the repository at this point in the history
the one from the thinroot.hosts file instead.
  • Loading branch information
jens-maus committed Sep 18, 2024
1 parent ff5959c commit a3ae9e0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion buildroot-external/rootfs-overlay/etc/init.d/S42LoadNetFiles
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ load_thinroot_hosts() {
fi
done

if [[ "${HOSTNAME}" == "localhost" ]]; then
# if no hostname can be queried (localhost or thinroot fallback), then
# we try to get it from the thinroot.hosts file instead
if [[ "${HOSTNAME}" == "localhost" ]] ||
[[ "${HOSTNAME}" == "thinroot" ]]; then
NEW_HOSTNAME=$(grep -m1 -i " ${MAC_ADDR}" "${TMPDIR}/thinroot.hosts" | cut -d" " -f1)
if [[ -n "${NEW_HOSTNAME}" && "${NEW_HOSTNAME}" != "-" ]]; then
/bin/hostname "${NEW_HOSTNAME}"
Expand Down

0 comments on commit a3ae9e0

Please sign in to comment.