mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-02-02 17:48:52 +00:00
Check for existence of wildcard blocking list before trying to acces it
This commit is contained in:
parent
a97f0b1298
commit
dce3e50a00
1 changed files with 13 additions and 11 deletions
24
pihole
24
pihole
|
@ -128,17 +128,19 @@ queryFunc() {
|
||||||
done
|
done
|
||||||
|
|
||||||
# Scan for possible wildcard matches
|
# Scan for possible wildcard matches
|
||||||
local wildcards=($(processWildcards "${domain}"))
|
if [ -e "${wildcardlist}" ]; then
|
||||||
for domain in ${wildcards[@]}; do
|
local wildcards=($(processWildcards "${domain}"))
|
||||||
result=$(scanList "\/${domain}\/" ${wildcardlist})
|
for domain in ${wildcards[@]}; do
|
||||||
# Remove empty lines before couting number of results
|
result=$(scanList "\/${domain}\/" ${wildcardlist})
|
||||||
count=$(sed '/^\s*$/d' <<< "$result" | wc -l)
|
# Remove empty lines before couting number of results
|
||||||
if [[ ${count} > 0 ]]; then
|
count=$(sed '/^\s*$/d' <<< "$result" | wc -l)
|
||||||
echo "::: Wildcard blocking ${domain} (${count} results)"
|
if [[ ${count} > 0 ]]; then
|
||||||
echo "${result}"
|
echo "::: Wildcard blocking ${domain} (${count} results)"
|
||||||
echo ""
|
echo "${result}"
|
||||||
fi
|
echo ""
|
||||||
done
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue