From 7a243f890eaf8939ac9b73bf3ae823ba0167d772 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 16 Dec 2016 17:33:01 +0100 Subject: [PATCH] Backend for privacyMode on webUI --- advanced/Scripts/webpage.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh index d07e5c94..135861df 100755 --- a/advanced/Scripts/webpage.sh +++ b/advanced/Scripts/webpage.sh @@ -212,6 +212,19 @@ SetDNSDomainName(){ } +SetPrivacyMode(){ + + # Remove setting from file (create backup setupVars.conf.bak) + sed -i.bak '/API_PRIVACY_MODE/d' /etc/pihole/setupVars.conf + # Save setting to file + if [[ "${args[2]}" == "true" ]] ; then + echo "API_PRIVACY_MODE=true" >> /etc/pihole/setupVars.conf + else + echo "API_PRIVACY_MODE=false" >> /etc/pihole/setupVars.conf + fi + +} + case "${args[1]}" in "-p" | "password" ) SetWebPassword;; "-c" | "celsius" ) unit="C"; SetTemperatureUnit;; @@ -227,6 +240,7 @@ case "${args[1]}" in "layout" ) SetWebUILayout;; "-h" | "--help" ) helpFunc;; "domainname" ) SetDNSDomainName;; + "privacymode" ) SetPrivacyMode;; * ) helpFunc;; esac