mirror of
https://github.com/pi-hole/pi-hole
synced 2024-11-15 20:49:01 +00:00
commit
8a327be400
@ -149,6 +149,10 @@ ProcessDNSSettings() {
|
||||
let COUNTER=COUNTER+1
|
||||
done
|
||||
|
||||
if [ ! -z "${LOCAL_DNS_PORT}" ]; then
|
||||
add_dnsmasq_setting "server" "127.0.0.1#${LOCAL_DNS_PORT}"
|
||||
fi
|
||||
|
||||
delete_dnsmasq_setting "domain-needed"
|
||||
|
||||
if [[ "${DNS_FQDN_REQUIRED}" == true ]]; then
|
||||
@ -525,6 +529,16 @@ SetPrivacyLevel() {
|
||||
changeFTLsetting "PRIVACYLEVEL" "${args[2]}"
|
||||
fi
|
||||
}
|
||||
SetLocalDNSport() {
|
||||
# Ensure port is a natural number { 0, 1, 2, 3, ... }
|
||||
if [[ "${1}" == "0" ]]; then
|
||||
delete_setting "LOCAL_DNS_PORT"
|
||||
ProcessDNSSettings
|
||||
elif [[ "${1}" =~ ^[0-9]+$ ]]; then
|
||||
change_setting "LOCAL_DNS_PORT" "${1}"
|
||||
ProcessDNSSettings
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
args=("$@")
|
||||
@ -556,6 +570,7 @@ main() {
|
||||
"adlist" ) CustomizeAdLists;;
|
||||
"audit" ) audit;;
|
||||
"-l" | "privacylevel" ) SetPrivacyLevel;;
|
||||
"localdnsport" ) SetLocalDNSport "$3";;
|
||||
* ) helpFunc;;
|
||||
esac
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user