mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 23:08:07 +00:00
Check if this domain is blocked by Pi-hole but only if the domain is not a local file or empty
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
df7633bd1b
commit
cc333f79cc
@ -517,6 +517,10 @@ gravity_DownloadBlocklistFromUrl() {
|
||||
str="Status:"
|
||||
echo -ne " ${INFO} ${str} Pending..."
|
||||
blocked=false
|
||||
|
||||
# Check if this domain is blocked by Pi-hole but only if the domain is not a
|
||||
# local file or empty
|
||||
if [[ $url != "file"* ]] && [[ -n "${domain}" ]]; then
|
||||
case $(getFTLConfigValue dns.blocking.mode) in
|
||||
"IP-NODATA-AAAA"|"IP")
|
||||
# Get IP address of this domain
|
||||
@ -539,7 +543,6 @@ gravity_DownloadBlocklistFromUrl() {
|
||||
fi;;
|
||||
esac
|
||||
|
||||
|
||||
if [[ "${blocked}" == true ]]; then
|
||||
# Get first defined upstream server
|
||||
local upstream
|
||||
@ -569,6 +572,7 @@ gravity_DownloadBlocklistFromUrl() {
|
||||
echo -ne " ${INFO} ${str} Pending..."
|
||||
cmd_ext="--resolve $domain:$port:$ip"
|
||||
fi
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
httpCode=$(curl --connect-timeout ${curl_connect_timeout} -s -L ${compression} ${cmd_ext} ${heisenbergCompensator} -w "%{http_code}" "${url}" -o "${listCurlBuffer}" 2> /dev/null)
|
||||
|
Loading…
Reference in New Issue
Block a user