Set domains and clients which are excluded by the API

This commit is contained in:
DL6ER 2016-12-11 19:30:04 +01:00
parent bf867bd9fd
commit 9ac378ae09

View file

@ -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 for var in "$@"; do
case "${var}" in case "${var}" in
"-p" | "password" ) SetWebPassword;; "-p" | "password" ) SetWebPassword;;
"-c" | "celsius" ) unit="C"; SetTemperatureUnit;; "-c" | "celsius" ) unit="C"; SetTemperatureUnit;;
"-f" | "fahrenheit" ) unit="F"; SetTemperatureUnit;; "-f" | "fahrenheit" ) unit="F"; SetTemperatureUnit;;
"setdns" ) SetDNSServers;; "setdns" ) SetDNSServers;;
"setexcludedomains" ) SetExcludeDomains;;
"setexcludeclients" ) SetExcludeClients;;
"-h" | "--help" ) helpFunc;; "-h" | "--help" ) helpFunc;;
esac esac
done done