1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 14:58:08 +00:00

quick fix for when dig also returns a CNAME

Signed-off-by: ryrun <ryrun@online.de>
This commit is contained in:
Andreas 2019-08-04 21:21:08 +02:00 committed by GitHub
parent f81e57d5b8
commit 63230cb72d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -349,7 +349,7 @@ gravity_DownloadBlocklistFromUrl() {
else
printf -v port "%s" "${PIHOLE_DNS_1#*#}"
fi
ip=$(dig "@${ip_addr}" -p "${port}" +short "${domain}")
ip=$(dig "@${ip_addr}" -p "${port}" +short "${domain}" | tail -1)
if [[ $(echo "${url}" | awk -F '://' '{print $1}') = "https" ]]; then
port=443;
else port=80