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>
pull/5571/head
DL6ER 7 months ago
parent df7633bd1b
commit cc333f79cc
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD

@ -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…
Cancel
Save