From e243c562c21e1c3d03c87812b45ac07c6f7194c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Fri, 3 Dec 2021 09:17:19 +0100 Subject: [PATCH 1/2] Unblock adlist domain during gravity run in NODATA mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- gravity.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gravity.sh b/gravity.sh index b2cd27b9..2ac9028a 100755 --- a/gravity.sh +++ b/gravity.sh @@ -596,6 +596,10 @@ gravity_DownloadBlocklistFromUrl() { if [[ $(dig "${domain}" | grep "NXDOMAIN" -c) -ge 1 ]]; then blocked=true fi;; + "NODATA") + if [[ $(dig "${domain}" | grep "NOERROR" -c) -ge 1 ]] && [[ -z $(dig +noall +answer "${domain}" |awk '{print $5}') ]]; then + blocked=true + fi;; "NULL"|*) if [[ $(dig "${domain}" +short | grep "0.0.0.0" -c) -ge 1 ]]; then blocked=true From db5e94b14a4e5a0208cd3515cfc4e25356335120 Mon Sep 17 00:00:00 2001 From: yubiuser Date: Tue, 21 Dec 2021 22:01:34 +0100 Subject: [PATCH 2/2] use +short and omit obsolet awk Co-authored-by: DL6ER --- gravity.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gravity.sh b/gravity.sh index 2ac9028a..8fd3a47b 100755 --- a/gravity.sh +++ b/gravity.sh @@ -597,7 +597,7 @@ gravity_DownloadBlocklistFromUrl() { blocked=true fi;; "NODATA") - if [[ $(dig "${domain}" | grep "NOERROR" -c) -ge 1 ]] && [[ -z $(dig +noall +answer "${domain}" |awk '{print $5}') ]]; then + if [[ $(dig "${domain}" | grep "NOERROR" -c) -ge 1 ]] && [[ -z $(dig +short "${domain}") ]]; then blocked=true fi;; "NULL"|*)