If running in debian image, make Lighttpd only listen on one IP. See diginc/docker-pi-hole#154

This commit is contained in:
BuildTools 2017-07-26 14:06:31 -05:00
parent 038930959f
commit 685cfe751a
1 changed files with 11 additions and 0 deletions

View File

@ -25,6 +25,17 @@ setup_dnsmasq
setup_php_env
setup_dnsmasq_hostnames "$ServerIP" "$ServerIPv6" "$HOSTNAME"
setup_ipv4_ipv6
if [[ "$IMAGE" == 'debian' ]] ; then
# if using '--net=host' only bing lighttpd on $ServerIP
HOSTNET='grep "docker" /proc/net/dev/' #docker (docker0 by default) should only be present on the host system
if [ -n "$HOSTNET" ] ; then
if ! grep "server.bind" /etc/lighttpd/lighttpd.conf # if the declaration is already there, don't add it again
then
sed -i -E "s/server\.port\s+\=\s+80/server.bind\t\t = \"${ServerIP}\"\nserver.port\t\t = 80/" /etc/lighttpd/lighttpd.conf
fi
fi
fi
test_configs
test_framework_stubbing
echo "::: Docker start setup complete - beginning s6 services"