mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-24 13:50:17 +00:00
Set domains and clients which are excluded by the API
This commit is contained in:
parent
bf867bd9fd
commit
9ac378ae09
1 changed files with 18 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue