Change command to "pihole -a localdnsport X"

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2018-04-18 17:30:51 +02:00
parent 24b8b4e904
commit ce35509a40
No known key found for this signature in database
GPG key ID: 00135ACBD90B28DD

View file

@ -149,8 +149,8 @@ ProcessDNSSettings() {
let COUNTER=COUNTER+1 let COUNTER=COUNTER+1
done done
if [ ! -z "${LOCAL_RECURSIVE}" ]; then if [ ! -z "${LOCAL_DNS_PORT}" ]; then
add_dnsmasq_setting "server" "127.0.0.1#${LOCAL_RECURSIVE}" add_dnsmasq_setting "server" "127.0.0.1#${LOCAL_DNS_PORT}"
fi fi
delete_dnsmasq_setting "domain-needed" delete_dnsmasq_setting "domain-needed"
@ -529,13 +529,13 @@ SetPrivacyLevel() {
changeFTLsetting "PRIVACYLEVEL" "${args[2]}" changeFTLsetting "PRIVACYLEVEL" "${args[2]}"
fi fi
} }
SetLocalRecursivePort() { SetLocalDNSport() {
# Ensure port is a natural number { 0, 1, 2, 3, ... } # Ensure port is a natural number { 0, 1, 2, 3, ... }
if [[ "${1}" == "0" ]]; then if [[ "${1}" == "0" ]]; then
delete_setting "LOCAL_RECURSIVE" delete_setting "LOCAL_DNS_PORT"
ProcessDNSSettings ProcessDNSSettings
elif [[ "${1}" =~ ^[0-9]+$ ]]; then elif [[ "${1}" =~ ^[0-9]+$ ]]; then
change_setting "LOCAL_RECURSIVE" "${1}" change_setting "LOCAL_DNS_PORT" "${1}"
ProcessDNSSettings ProcessDNSSettings
fi fi
} }
@ -570,7 +570,7 @@ main() {
"adlist" ) CustomizeAdLists;; "adlist" ) CustomizeAdLists;;
"audit" ) audit;; "audit" ) audit;;
"-l" | "privacylevel" ) SetPrivacyLevel;; "-l" | "privacylevel" ) SetPrivacyLevel;;
"localrecursivedns" ) SetLocalRecursivePort "$3";; "localdnsport" ) SetLocalDNSport "$3";;
* ) helpFunc;; * ) helpFunc;;
esac esac