mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-23 21:30:17 +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)
|
||||
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;;
|
||||
|
|
1
pihole
1
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 "$@";;
|
||||
|
|
Loading…
Reference in a new issue