Skip to content

Commit 7c93323

Browse files
committed
proxydhcp - get container IP differently
1 parent b326528 commit 7c93323

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

root/init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if [[ ! -f /config/dnsmasq/dnsmasq.conf ]]; then
2525

2626
# Get the container's IP address using hostname if not already set
2727
if [ -z "${CONTAINER_IP}" ]; then
28-
CONTAINER_IP=$(hostname -i)
28+
CONTAINER_IP=$(ip -4 addr show eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
2929
export CONTAINER_IP
3030
fi
3131
envsubst '${DHCP_RANGE_START} ${CONTAINER_IP}' </defaults/dnsmasq-dhcpproxy.conf >>/config/dnsmasq/dnsmasq.conf

0 commit comments

Comments
 (0)