From 9ac378ae09a5c484b891963bb78a9b657a518116 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 11 Dec 2016 19:30:04 +0100 Subject: [PATCH] Set domains and clients which are excluded by the API --- advanced/Scripts/webpage.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh index 839f6e6d..35ba6875 100755 --- a/advanced/Scripts/webpage.sh +++ b/advanced/Scripts/webpage.sh @@ -67,12 +67,30 @@ SetDNSServers(){ } +SetExcludeDomains(){ + + # Remove setting from file (create backup setupVars.conf.bak) + sed -i.bak '/API_EXCLUDE_DOMAINS/d;' /etc/pihole/setupVars.conf + # Save setting to file + echo "API_EXCLUDE_DOMAINS=${args[2]}" >> /etc/pihole/setupVars.conf +} + +SetExcludeClients(){ + + # Remove setting from file (create backup setupVars.conf.bak) + sed -i.bak '/API_EXCLUDE_CLIENTS/d;' /etc/pihole/setupVars.conf + # Save setting to file + echo "API_EXCLUDE_CLIENTS=${args[2]}" >> /etc/pihole/setupVars.conf +} + for var in "$@"; do case "${var}" in "-p" | "password" ) SetWebPassword;; "-c" | "celsius" ) unit="C"; SetTemperatureUnit;; "-f" | "fahrenheit" ) unit="F"; SetTemperatureUnit;; "setdns" ) SetDNSServers;; + "setexcludedomains" ) SetExcludeDomains;; + "setexcludeclients" ) SetExcludeClients;; "-h" | "--help" ) helpFunc;; esac done