mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Add undocumented --whitewild option that does the same --wild does for the whitelist.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
0692be9bae
commit
40d0caa70b
2 changed files with 3 additions and 1 deletions
|
@ -75,7 +75,7 @@ HandleOther() {
|
||||||
|
|
||||||
# Check validity of domain (don't check for regex entries)
|
# Check validity of domain (don't check for regex entries)
|
||||||
if [[ "${#domain}" -le 253 ]]; then
|
if [[ "${#domain}" -le 253 ]]; then
|
||||||
if [[ "${listType}" == "regex_blacklist" && "${wildcard}" == false ]]; then
|
if [[ ( "${listType}" == "regex_blacklist" || "${listType}" == "regex_whitelist" ) && "${wildcard}" == false ]]; then
|
||||||
validDomain="${domain}"
|
validDomain="${domain}"
|
||||||
else
|
else
|
||||||
validDomain=$(grep -P "^((-|_)*[a-z\\d]((-|_)*[a-z\\d])*(-|_)*)(\\.(-|_)*([a-z\\d]((-|_)*[a-z\\d])*))*$" <<< "${domain}") # Valid chars check
|
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;;
|
"--wild" | "wildcard" ) listType="regex_blacklist"; wildcard=true;;
|
||||||
"--regex" | "regex" ) listType="regex_blacklist";;
|
"--regex" | "regex" ) listType="regex_blacklist";;
|
||||||
"--whiteregex" | "whiteregex" ) listType="regex_whitelist";;
|
"--whiteregex" | "whiteregex" ) listType="regex_whitelist";;
|
||||||
|
"--whitewild" | "whitewild" ) listType="regex_whitelist"; wildcard=true;;
|
||||||
"-nr"| "--noreload" ) reload=false;;
|
"-nr"| "--noreload" ) reload=false;;
|
||||||
"-d" | "--delmode" ) addmode=false;;
|
"-d" | "--delmode" ) addmode=false;;
|
||||||
"-q" | "--quiet" ) verbose=false;;
|
"-q" | "--quiet" ) verbose=false;;
|
||||||
|
|
1
pihole
1
pihole
|
@ -440,6 +440,7 @@ case "${1}" in
|
||||||
"--wild" | "wildcard" ) listFunc "$@";;
|
"--wild" | "wildcard" ) listFunc "$@";;
|
||||||
"--regex" | "regex" ) listFunc "$@";;
|
"--regex" | "regex" ) listFunc "$@";;
|
||||||
"--whiteregex" | "whiteregex" ) listFunc "$@";;
|
"--whiteregex" | "whiteregex" ) listFunc "$@";;
|
||||||
|
"--whitewild" | "whitewild" ) listFunc "$@";;
|
||||||
"-d" | "debug" ) debugFunc "$@";;
|
"-d" | "debug" ) debugFunc "$@";;
|
||||||
"-f" | "flush" ) flushFunc "$@";;
|
"-f" | "flush" ) flushFunc "$@";;
|
||||||
"-up" | "updatePihole" ) updatePiholeFunc "$@";;
|
"-up" | "updatePihole" ) updatePiholeFunc "$@";;
|
||||||
|
|
Loading…
Reference in a new issue