From c7eb225de47bc3ff92b19d8ad9a8969e7035bbab Mon Sep 17 00:00:00 2001 From: rootzoll Date: Thu, 4 Apr 2024 13:30:36 +0200 Subject: [PATCH] sd card build prevent "unable to resolve host debian" error --- build_sdcard.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build_sdcard.sh b/build_sdcard.sh index 343abe664..13ccda356 100644 --- a/build_sdcard.sh +++ b/build_sdcard.sh @@ -294,6 +294,15 @@ echo "[Login] HandleLidSwitch=ignore HandleLidSwitchDocked=ignore" | tee /etc/systemd/logind.conf.d/nosuspend.conf +# check if /etc/hosts already has debian entry +# prevent "unable to resolve host debian" error +isDebianInHosts=$(grep -c "debian" /etc/hosts) +if [ ${isDebianInHosts} -eq 0 ]; then + echo "# Adding debian to /etc/hosts" + echo "127.0.1.1 debian" | tee -a /etc/hosts > /dev/null + systemctl restart networking +fi + # FIXING LOCALES # https://github.com/rootzoll/raspiblitz/issues/138 # https://daker.me/2014/10/how-to-fix-perl-warning-setting-locale-failed-in-raspbian.html