Add undocumented --whitewild option that does the same --wild does for the whitelist.

Signed-off-by: DL6ER <dl6er@dl6er.de>
pull/2838/head
DL6ER 5 years ago
parent 0692be9bae
commit 40d0caa70b
No known key found for this signature in database
GPG Key ID: FB60471F0575164A

@ -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;;

@ -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 "$@";;

Loading…
Cancel
Save