From 4870383a06a9433b87d4768b1fe59f2c371c99df Mon Sep 17 00:00:00 2001 From: Gyurix Date: Sat, 19 Oct 2024 11:28:51 +0200 Subject: [PATCH] corrected hosts file name --- entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index c46e614..8312bfa 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,14 +3,14 @@ DOMAIN=$DOMAIN SELECTOR=$HOMEASSISTANT HOMEASSISTANT_IP=$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d '/' -f1) -HOST_FILE=/etc/system/data/dns/host.local; +HOST_FILE=/etc/system/data/dns/hosts.local; EXISTS=$(grep -w -F $SELECTOR $HOST_FILE); if [ -n "$EXISTS" ]; then # selector already exists in hosts file and SCALE is not in use IP=$(echo $EXISTS | cut -d ' ' -f1); - sed "s/'$IP'/'$HOMEASSISTANT_IP'/g" $HOST_FILE > /tmp/host.local - mv /tmp/host.local $HOST_FILE; + sed "s/'$IP'/'$HOMEASSISTANT_IP'/g" $HOST_FILE > /tmp/hosts.local + mv /tmp/hosts.local $HOST_FILE; else echo "'$HOMEASSISTANT_IP' '$SELECTOR'" >> $HOST_FILE fi