From 243f53c1ae307b0d7a6184f41e369d0c3fa0c776 Mon Sep 17 00:00:00 2001 From: Robert Coleman <154176+rjocoleman@users.noreply.github.com> Date: Wed, 15 Jan 2025 10:30:03 +1300 Subject: [PATCH] proxydhcp - get container IP differently --- root/init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/init.sh b/root/init.sh index 61c49bb..ae65256 100755 --- a/root/init.sh +++ b/root/init.sh @@ -25,7 +25,7 @@ if [[ ! -f /config/dnsmasq/dnsmasq.conf ]]; then # Get the container's IP address using hostname if not already set if [ -z "${CONTAINER_IP}" ]; then - CONTAINER_IP=$(hostname -i) + CONTAINER_IP=$(ip -4 addr show eth0 | awk '/inet / {print $2}' | cut -d/ -f1) export CONTAINER_IP fi envsubst '${DHCP_RANGE_START} ${CONTAINER_IP}' >/config/dnsmasq/dnsmasq.conf