Make Lighttpd also bind to localhost when using host network

This commit is contained in:
DerFetzer 2018-01-13 15:23:12 +00:00
parent 7758a3962c
commit 9427357489
1 changed files with 2 additions and 2 deletions

View File

@ -133,10 +133,10 @@ setup_dnsmasq_hostnames() {
setup_lighttpd_bind() {
if [[ "$TAG" == 'debian' ]] ; then
# if using '--net=host' only bind lighttpd on $ServerIP
# if using '--net=host' only bind lighttpd on $ServerIP and localhost
if grep -q "docker" /proc/net/dev ; then #docker (docker0 by default) should only be present on the host system
if ! grep -q "server.bind" /etc/lighttpd/lighttpd.conf ; then # if the declaration is already there, don't add it again
sed -i -E "s/server\.port\s+\=\s+80/server.bind\t\t = \"${ServerIP}\"\nserver.port\t\t = 80/" /etc/lighttpd/lighttpd.conf
sed -i -E "s/server\.port\s+\=\s+80/server.bind\t\t = \"${ServerIP}\"\nserver.port\t\t = 80\n"\$SERVER"\[\"socket\"\] == \"127\.0\.0\.1:80\" \{\}/" /etc/lighttpd/lighttpd.conf
fi
fi
fi