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

Account for port, or lack of, in PIHOLE_DNS_1

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
Dan Schaper 2018-11-12 17:15:24 -08:00
parent 1f596eb2bc
commit f9e71bee0a
No known key found for this signature in database
GPG Key ID: B4FF14C01CC08DC0

View File

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