Update queryFunc() to search Whitelist

If there is a match in Whitelist/Blacklist/Wildcards, `[ ! -t 1 ]` will cause the search to end if the terminal is closed when the script is called. This has the intended effect of allowing a user to search for a W/B/W domain (as well as all the adlists it's found in) using `pihole -q` via Terminal, but the script will stop searching after a W/B/W match when called by the block page.
This commit is contained in:
WaLLy3K 2017-05-11 19:58:35 +10:00 committed by GitHub
parent 5e0572637e
commit 58353e2839

6
pihole
View file

@ -106,12 +106,12 @@ queryFunc() {
domain="${2}"
fi
# Scan Blacklist and Wildcards
lists="/etc/pihole/blacklist.txt $wildcardlist"
# Scan Whitelist, Blacklist and Wildcards
lists="/etc/pihole/whitelist.txt /etc/pihole/blacklist.txt $wildcardlist"
result=$(scanList ${domain} "${lists}" ${method})
if [ -n "$result" ]; then
echo "$result"
exit 0
[ ! -t 1 ] && exit 0
fi
# Scan Domains lists