Show only exact matches for pihole -q
This commit is contained in:
parent
b6639d9e7e
commit
fb72ac9904
4
pihole
4
pihole
|
@ -71,10 +71,10 @@ queryFunc() {
|
|||
domain="${2}"
|
||||
lists=( /etc/pihole/list.* /etc/pihole/blacklist.txt)
|
||||
for list in ${lists[@]}; do
|
||||
count=$(grep -c ${domain} $list)
|
||||
count=$(grep -c -E "(^|\s)${domain}($|\s)" $list)
|
||||
echo "::: ${list} (${count} results)"
|
||||
if [[ ${count} > 0 ]]; then
|
||||
grep ${domain} ${list}
|
||||
grep -E "(^|\s)${domain}($|\s)" ${list}
|
||||
fi
|
||||
echo ""
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue