mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-25 06:10:20 +00:00
Show only exact matches for pihole -q
This commit is contained in:
parent
b6639d9e7e
commit
fb72ac9904
1 changed files with 2 additions and 2 deletions
4
pihole
4
pihole
|
@ -71,10 +71,10 @@ queryFunc() {
|
||||||
domain="${2}"
|
domain="${2}"
|
||||||
lists=( /etc/pihole/list.* /etc/pihole/blacklist.txt)
|
lists=( /etc/pihole/list.* /etc/pihole/blacklist.txt)
|
||||||
for list in ${lists[@]}; do
|
for list in ${lists[@]}; do
|
||||||
count=$(grep -c ${domain} $list)
|
count=$(grep -c -E "(^|\s)${domain}($|\s)" $list)
|
||||||
echo "::: ${list} (${count} results)"
|
echo "::: ${list} (${count} results)"
|
||||||
if [[ ${count} > 0 ]]; then
|
if [[ ${count} > 0 ]]; then
|
||||||
grep ${domain} ${list}
|
grep -E "(^|\s)${domain}($|\s)" ${list}
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue