From 40d0caa70b642382b2ca35344e6da7fd6c452432 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 22 Jul 2019 21:03:42 +0200 Subject: [PATCH] Add undocumented --whitewild option that does the same --wild does for the whitelist. Signed-off-by: DL6ER --- advanced/Scripts/list.sh | 3 ++- pihole | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/advanced/Scripts/list.sh b/advanced/Scripts/list.sh index 4ef86407..0183a9e2 100755 --- a/advanced/Scripts/list.sh +++ b/advanced/Scripts/list.sh @@ -75,7 +75,7 @@ HandleOther() { # Check validity of domain (don't check for regex entries) if [[ "${#domain}" -le 253 ]]; then - if [[ "${listType}" == "regex_blacklist" && "${wildcard}" == false ]]; then + if [[ ( "${listType}" == "regex_blacklist" || "${listType}" == "regex_whitelist" ) && "${wildcard}" == false ]]; then validDomain="${domain}" else validDomain=$(grep -P "^((-|_)*[a-z\\d]((-|_)*[a-z\\d])*(-|_)*)(\\.(-|_)*([a-z\\d]((-|_)*[a-z\\d])*))*$" <<< "${domain}") # Valid chars check @@ -224,6 +224,7 @@ for var in "$@"; do "--wild" | "wildcard" ) listType="regex_blacklist"; wildcard=true;; "--regex" | "regex" ) listType="regex_blacklist";; "--whiteregex" | "whiteregex" ) listType="regex_whitelist";; + "--whitewild" | "whitewild" ) listType="regex_whitelist"; wildcard=true;; "-nr"| "--noreload" ) reload=false;; "-d" | "--delmode" ) addmode=false;; "-q" | "--quiet" ) verbose=false;; diff --git a/pihole b/pihole index 411b5791..b3260d83 100755 --- a/pihole +++ b/pihole @@ -440,6 +440,7 @@ case "${1}" in "--wild" | "wildcard" ) listFunc "$@";; "--regex" | "regex" ) listFunc "$@";; "--whiteregex" | "whiteregex" ) listFunc "$@";; + "--whitewild" | "whitewild" ) listFunc "$@";; "-d" | "debug" ) debugFunc "$@";; "-f" | "flush" ) flushFunc "$@";; "-up" | "updatePihole" ) updatePiholeFunc "$@";;