Merge pull request #334 from dhutchison/development

Implemented missing support for DNSMASQ_LISTENING environment variable
This commit is contained in:
Adam Hill 2018-10-27 12:01:04 -05:00 committed by GitHub
commit 3870154ae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -120,6 +120,14 @@ setup_dnsmasq_interface() {
[ -n "$interface" ] && change_setting "PIHOLE_INTERFACE" "${interface}"
}
setup_dnsmasq_listening_behaviour() {
local dnsmasq_listening_behaviour="${1}"
if [ -n "$dnsmasq_listening_behaviour" ]; then
change_setting "DNSMASQ_LISTENING" "${dnsmasq_listening_behaviour}"
fi;
}
setup_dnsmasq_config_if_missing() {
# When fresh empty directory volumes are used we miss this file
if [ ! -f /etc/dnsmasq.d/01-pihole.conf ] ; then
@ -131,10 +139,12 @@ setup_dnsmasq() {
local dns1="$1"
local dns2="$2"
local interface="$3"
local dnsmasq_listening_behaviour="$4"
# Coordinates
setup_dnsmasq_config_if_missing
setup_dnsmasq_dns "$dns1" "$dns2"
setup_dnsmasq_interface "$interface"
setup_dnsmasq_listening_behaviour "$dnsmasq_listening_behaviour"
ProcessDNSSettings
}

View File

@ -11,6 +11,7 @@ export WEBLOGDIR
export DNS1
export DNS2
export INTERFACE
export DNSMASQ_LISTENING_BEHAVIOUR="$DNSMASQ_LISTENING"
export IPv6
export WEB_PORT
@ -32,7 +33,7 @@ change_setting "IPV4_ADDRESS" "$ServerIP"
change_setting "IPV6_ADDRESS" "$ServerIPv6"
setup_web_port "$WEB_PORT"
setup_web_password "$WEBPASSWORD"
setup_dnsmasq "$DNS1" "$DNS2" "$INTERFACE"
setup_dnsmasq "$DNS1" "$DNS2" "$INTERFACE" "$DNSMASQ_LISTENING_BEHAVIOUR"
setup_php_env
setup_dnsmasq_hostnames "$ServerIP" "$ServerIPv6" "$HOSTNAME"
setup_ipv4_ipv6