From d21298c156be40653cb42d1d1ae723a993bf8e1f Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Sat, 7 Jul 2018 15:23:47 -0400 Subject: [PATCH] Add back conditional forwarding to webpage.sh This was accidentally removed in a previous PR. Signed-off-by: Mcat12 --- advanced/Scripts/webpage.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh index 48161604..3c6f1fb5 100755 --- a/advanced/Scripts/webpage.sh +++ b/advanced/Scripts/webpage.sh @@ -205,6 +205,10 @@ trust-anchor=.,20326,8,2,E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC68345710423 add_dnsmasq_setting "interface" "${PIHOLE_INTERFACE}" fi + if [[ "${CONDITIONAL_FORWARDING}" == true ]]; then + add_dnsmasq_setting "server=/${CONDITIONAL_FORWARDING_DOMAIN}/${CONDITIONAL_FORWARDING_IP}" + add_dnsmasq_setting "server=/${CONDITIONAL_FORWARDING_REVERSE}/${CONDITIONAL_FORWARDING_IP}" + fi } SetDNSServers() { @@ -234,6 +238,18 @@ SetDNSServers() { change_setting "DNSSEC" "false" fi + if [[ "${args[6]}" == "conditional_forwarding" ]]; then + change_setting "CONDITIONAL_FORWARDING" "true" + change_setting "CONDITIONAL_FORWARDING_IP" "${args[7]}" + change_setting "CONDITIONAL_FORWARDING_DOMAIN" "${args[8]}" + change_setting "CONDITIONAL_FORWARDING_REVERSE" "${args[9]}" + else + change_setting "CONDITIONAL_FORWARDING" "false" + delete_setting "CONDITIONAL_FORWARDING_IP" + delete_setting "CONDITIONAL_FORWARDING_DOMAIN" + delete_setting "CONDITIONAL_FORWARDING_REVERSE" + fi + ProcessDNSSettings # Restart dnsmasq to load new configuration