From 58353e28399c1e36568526475d71114558db392c Mon Sep 17 00:00:00 2001 From: WaLLy3K Date: Thu, 11 May 2017 19:58:35 +1000 Subject: [PATCH] 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. --- pihole | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pihole b/pihole index 6bd5fb1f..95dd7a1c 100755 --- a/pihole +++ b/pihole @@ -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