aboutsummaryrefslogtreecommitdiff
path: root/net/adblock
diff options
context:
space:
mode:
authorDirk Brenken <dev@brenken.org>2020-11-29 08:46:28 +0100
committerDirk Brenken <dev@brenken.org>2020-11-29 08:46:28 +0100
commit6e90c8fa5313937d51b1c3b8e933d123b0726602 (patch)
tree451a934572be1ab47447bb188d0c7a22504d89fd /net/adblock
parent0607d26df00f0585eb6db442ef8dd74974cd4c14 (diff)
adblock: reporting fixes/tweaks
* prevents the creation of an invalid json structure * add more space to the domain column on cli Signed-off-by: Dirk Brenken <dev@brenken.org>
Diffstat (limited to 'net/adblock')
-rw-r--r--net/adblock/Makefile2
-rwxr-xr-xnet/adblock/files/adblock.sh8
2 files changed, 5 insertions, 5 deletions
diff --git a/net/adblock/Makefile b/net/adblock/Makefile
index e6068f7ca..4857d9b7a 100644
--- a/net/adblock/Makefile
+++ b/net/adblock/Makefile
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=adblock
PKG_VERSION:=4.0.7
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
diff --git a/net/adblock/files/adblock.sh b/net/adblock/files/adblock.sh
index d096cce24..55df0278f 100755
--- a/net/adblock/files/adblock.sh
+++ b/net/adblock/files/adblock.sh
@@ -1486,8 +1486,8 @@ f_report()
do
(
"${adb_dumpcmd}" -tttt -r "${file}" 2>/dev/null | \
- "${adb_awk}" -v cnt="${cnt}" '!/\.lan\. |PTR\? | SOA\? /&&/ A[\? ]+|NXDomain|0\.0\.0\.0/{a=$1;b=substr($2,0,8);c=$4;sub(/\.[0-9]+$/,"",c);d=cnt $7;sub(/\*$/,"",d);
- e=$(NF-1);sub(/[0-9]\/[0-9]\/[0-9]|0\.0\.0\.0/,"NX",e);sub(/\.$/,"",e);sub(/([0-9]{1,3}\.){3}[0-9]{1,3}/,"OK",e);if(e==""){e="err"};printf "%s\t%s\t%s\t%s\t%s\n",d,e,a,b,c}' >> "${adb_reportdir}/adb_report.raw"
+ "${adb_awk}" -v cnt="${cnt}" '!/\.lan\. |PTR\? | SOA\? /&&/ A[\? ]+|NXDomain|0\.0\.0\.0/{a=$1;b=substr($2,0,8);c=$4;sub(/\.[0-9]+$/,"",c);gsub(/[^[:alnum:]\.:-]/,"",c);d=cnt $7;sub(/\*$/,"",d);
+ e=$(NF-1);sub(/[0-9]\/[0-9]\/[0-9]|0\.0\.0\.0/,"NX",e);sub(/\.$/,"",e);sub(/([0-9]{1,3}\.){3}[0-9]{1,3}/,"OK",e);gsub(/[^[:alnum:]\.-]/,"",e);if(e==""){e="err"};printf "%s\t%s\t%s\t%s\t%s\n",d,e,a,b,c}' >> "${adb_reportdir}/adb_report.raw"
)&
hold=$((cnt%adb_maxqueue))
if [ "${hold}" -eq 0 ]
@@ -1593,13 +1593,13 @@ f_report()
elif json_get_type status "${top}" && [ "${top}" = "requests" ] && [ "${status}" = "array" ]
then
printf "%s\\n%s\\n%s\\n" ":::" "::: Latest DNS Queries" ":::"
- printf "%-15s%-15s%-45s%-50s%s\\n" "Date" "Time" "Client" "Domain" "Answer"
+ printf "%-15s%-15s%-45s%-80s%s\\n" "Date" "Time" "Client" "Domain" "Answer"
json_select "${top}"
index=1
while json_get_type status "${index}" && [ "${status}" = "object" ]
do
json_get_values item "${index}"
- printf "%-15s%-15s%-45s%-50s%s\\n" ${item}
+ printf "%-15s%-15s%-45s%-80s%s\\n" ${item}
index=$((index+1))
done
fi