From afabb5957b5265385466eb960390c99c33956b27 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 15 Dec 2016 18:55:40 +0100 Subject: [PATCH] Implement backend for https://github.com/pi-hole/AdminLTE/pull/253 --- advanced/Scripts/webpage.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh index d07e5c94..3e686b93 100755 --- a/advanced/Scripts/webpage.sh +++ b/advanced/Scripts/webpage.sh @@ -212,6 +212,20 @@ SetDNSDomainName(){ } +ResolutionSettings() { + + typ=${args[2]} + state=${args[3]} + + if [[ "${typ}" == "forward" ]]; then + sed -i.bak '/API_GET_UPSTREAM_DNS_HOSTNAME/d;' /etc/pihole/setupVars.conf + echo "API_GET_UPSTREAM_DNS_HOSTNAME=${state}" >> /etc/pihole/setupVars.conf + elif [[ "${typ}" == "clients" ]]; then + sed -i.bak '/API_GET_CLIENT_HOSTNAME/d;' /etc/pihole/setupVars.conf + echo "API_GET_CLIENT_HOSTNAME=${state}" >> /etc/pihole/setupVars.conf + fi +} + case "${args[1]}" in "-p" | "password" ) SetWebPassword;; "-c" | "celsius" ) unit="C"; SetTemperatureUnit;; @@ -227,6 +241,7 @@ case "${args[1]}" in "layout" ) SetWebUILayout;; "-h" | "--help" ) helpFunc;; "domainname" ) SetDNSDomainName;; + "resolve" ) ResolutionSettings;; * ) helpFunc;; esac