Browse Source

Merge pull request #14065 from dibdot/adblock

adblock: reporting fixes/tweaks
lilik-openwrt-22.03
Dirk Brenken 4 years ago
committed by GitHub
parent
commit
4fad6e2dc1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions
  1. +1
    -1
      net/adblock/Makefile
  2. +4
    -4
      net/adblock/files/adblock.sh

+ 1
- 1
net/adblock/Makefile View File

@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=adblock PKG_NAME:=adblock
PKG_VERSION:=4.0.7 PKG_VERSION:=4.0.7
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org> PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>


+ 4
- 4
net/adblock/files/adblock.sh View File

@ -1486,8 +1486,8 @@ f_report()
do do
( (
"${adb_dumpcmd}" -tttt -r "${file}" 2>/dev/null | \ "${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)) hold=$((cnt%adb_maxqueue))
if [ "${hold}" -eq 0 ] if [ "${hold}" -eq 0 ]
@ -1593,13 +1593,13 @@ f_report()
elif json_get_type status "${top}" && [ "${top}" = "requests" ] && [ "${status}" = "array" ] elif json_get_type status "${top}" && [ "${top}" = "requests" ] && [ "${status}" = "array" ]
then then
printf "%s\\n%s\\n%s\\n" ":::" "::: Latest DNS Queries" ":::" 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}" json_select "${top}"
index=1 index=1
while json_get_type status "${index}" && [ "${status}" = "object" ] while json_get_type status "${index}" && [ "${status}" = "object" ]
do do
json_get_values item "${index}" json_get_values item "${index}"
printf "%-15s%-15s%-45s%-50s%s\\n" ${item}
printf "%-15s%-15s%-45s%-80s%s\\n" ${item}
index=$((index+1)) index=$((index+1))
done done
fi fi


Loading…
Cancel
Save