mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Don't let one blocklist, block an other
If a blocklist is blocked by an other and 'pihole -g' is run, update the blocked blocklist by useing an alternate dns server (in this case 1.1.1.1) to acquire the IP adres and download the blocklist using the 'curl --resolve' (https://curl.haxx.se/docs/manpage.html#--resolve)
This commit is contained in:
parent
ddbdb51d20
commit
3e5c6afaee
1 changed files with 11 additions and 0 deletions
11
gravity.sh
11
gravity.sh
|
@ -217,6 +217,17 @@ gravity_DownloadBlocklistFromUrl() {
|
||||||
str="Status:"
|
str="Status:"
|
||||||
echo -ne " ${INFO} ${str} Pending..."
|
echo -ne " ${INFO} ${str} Pending..."
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
|
if [ `dig $domain +short | grep 0.0.0.0 -c` -ge 1 ]; then
|
||||||
|
ip=`dig @1.1.1.1 +short $domain`
|
||||||
|
if [ `echo $url | awk -F '://' '{print $1}'` = "https" ]; then
|
||||||
|
port=443;
|
||||||
|
else
|
||||||
|
port=80
|
||||||
|
fi
|
||||||
|
echo -e "${OVER} ${CROSS} ${str} ${domain} is currently blocked by pi-hole. Circumventing pi-hole and trying again";
|
||||||
|
echo -ne " ${INFO} ${str} Pending..."
|
||||||
|
cmd_ext="--resolve $domain:$port:$ip $cmd_ext"
|
||||||
|
fi
|
||||||
httpCode=$(curl -s -L ${cmd_ext} ${heisenbergCompensator} -w "%{http_code}" -A "${agent}" "${url}" -o "${patternBuffer}" 2> /dev/null)
|
httpCode=$(curl -s -L ${cmd_ext} ${heisenbergCompensator} -w "%{http_code}" -A "${agent}" "${url}" -o "${patternBuffer}" 2> /dev/null)
|
||||||
|
|
||||||
case $url in
|
case $url in
|
||||||
|
|
Loading…
Reference in a new issue