adblock: update 4.1.4-2
* some more cleanups, forgotten with the last update * optimized unbound syntax ('always_nxdomain' & 'always_transparent') * optimized oisd download sources (use wilcard variants which are much smaller) * removed superfluous version information/function Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
parent
254b3d9380
commit
54f493ed9d
4 changed files with 15 additions and 28 deletions
|
@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=adblock
|
PKG_NAME:=adblock
|
||||||
PKG_VERSION:=4.1.4
|
PKG_VERSION:=4.1.4
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
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>
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@ if [ -n "$(type -t extra_command)" ]; then
|
||||||
extra_command "report" "[[<cli>|<mail>|<gen>|<json>] [<count>] [<search>]] Print DNS statistics with an optional search parameter"
|
extra_command "report" "[[<cli>|<mail>|<gen>|<json>] [<count>] [<search>]] Print DNS statistics with an optional search parameter"
|
||||||
extra_command "list" "[<add>|<add_sha>|<add_utc>|<add_eng>|<add_stb>|<remove>|<remove_sha>|<remove_utc>|<remove_eng>|<remove_stb>] <source(s)> List/Edit available sources"
|
extra_command "list" "[<add>|<add_sha>|<add_utc>|<add_eng>|<add_stb>|<remove>|<remove_sha>|<remove_utc>|<remove_eng>|<remove_stb>] <source(s)> List/Edit available sources"
|
||||||
extra_command "timer" "[<add> <tasks> <hour> [<minute>] [<weekday>]]|[<remove> <line no.>] List/Edit cron update intervals"
|
extra_command "timer" "[<add> <tasks> <hour> [<minute>] [<weekday>]]|[<remove> <line no.>] List/Edit cron update intervals"
|
||||||
extra_command "version" "Print version information"
|
|
||||||
else
|
else
|
||||||
EXTRA_COMMANDS="status suspend resume query report list timer version"
|
EXTRA_COMMANDS="status suspend resume query report list timer version"
|
||||||
EXTRA_HELP=" status Service status
|
EXTRA_HELP=" status Service status
|
||||||
|
@ -24,8 +23,7 @@ else
|
||||||
query <domain> Query active blocklists and backups for a specific domain
|
query <domain> Query active blocklists and backups for a specific domain
|
||||||
report [[<cli>|<mail>|<gen>|<json>] [<count>] [<search>]] Print DNS statistics with an optional search parameter
|
report [[<cli>|<mail>|<gen>|<json>] [<count>] [<search>]] Print DNS statistics with an optional search parameter
|
||||||
list [<add>|<add_sha>|<add_utc>|<add_eng>|<add_stb>|<remove>|<remove_sha>|<remove_utc>|<remove_eng>|<remove_stb>] <source(s)> List/Edit available sources
|
list [<add>|<add_sha>|<add_utc>|<add_eng>|<add_stb>|<remove>|<remove_sha>|<remove_utc>|<remove_eng>|<remove_stb>] <source(s)> List/Edit available sources
|
||||||
timer [<add> <tasks> <hour> [<minute>] [<weekday>]]|[<remove> <line no.>] List/Edit cron update intervals
|
timer [<add> <tasks> <hour> [<minute>] [<weekday>]]|[<remove> <line no.>] List/Edit cron update intervals"
|
||||||
version Print version information"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
adb_init="/etc/init.d/adblock"
|
adb_init="/etc/init.d/adblock"
|
||||||
|
@ -39,10 +37,6 @@ if [ -s "${adb_pidfile}" ] && { [ "${action}" = "start" ] || [ "${action}" = "st
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
version() {
|
|
||||||
rc_procd "${adb_script}" version
|
|
||||||
}
|
|
||||||
|
|
||||||
boot() {
|
boot() {
|
||||||
[ -s "${adb_pidfile}" ] && : >"${adb_pidfile}"
|
[ -s "${adb_pidfile}" ] && : >"${adb_pidfile}"
|
||||||
rc_procd start_service
|
rc_procd start_service
|
||||||
|
|
|
@ -104,7 +104,7 @@ f_load() {
|
||||||
if [ -x "${adb_dumpcmd}" ] && { [ "${adb_report}" = "0" ] || { [ -n "${bg_pid}" ] && { [ "${adb_action}" = "stop" ] || [ "${adb_action}" = "restart" ]; }; }; }; then
|
if [ -x "${adb_dumpcmd}" ] && { [ "${adb_report}" = "0" ] || { [ -n "${bg_pid}" ] && { [ "${adb_action}" = "stop" ] || [ "${adb_action}" = "restart" ]; }; }; }; then
|
||||||
if [ -n "${bg_pid}" ]; then
|
if [ -n "${bg_pid}" ]; then
|
||||||
kill -HUP "${bg_pid}" 2>/dev/null
|
kill -HUP "${bg_pid}" 2>/dev/null
|
||||||
while $(kill -0 "${bg_pid}" 2>/dev/null); do
|
while kill -0 "${bg_pid}" 2>/dev/null; do
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
unset bg_pid
|
unset bg_pid
|
||||||
|
@ -270,10 +270,10 @@ f_dns() {
|
||||||
adb_dnsuser="${adb_dnsuser:-"unbound"}"
|
adb_dnsuser="${adb_dnsuser:-"unbound"}"
|
||||||
adb_dnsdir="${adb_dnsdir:-"/var/lib/unbound"}"
|
adb_dnsdir="${adb_dnsdir:-"/var/lib/unbound"}"
|
||||||
adb_dnsheader="${adb_dnsheader:-""}"
|
adb_dnsheader="${adb_dnsheader:-""}"
|
||||||
adb_dnsdeny="${adb_dnsdeny:-"${adb_awk} '{print \"local-zone: \\042\"\$0\"\\042 static\"}'"}"
|
adb_dnsdeny="${adb_dnsdeny:-"${adb_awk} '{print \"local-zone: \\042\"\$0\"\\042 always_nxdomain\"}'"}"
|
||||||
adb_dnsallow="${adb_dnsallow:-"${adb_awk} '{print \"local-zone: \\042\"\$0\"\\042 transparent\"}'"}"
|
adb_dnsallow="${adb_dnsallow:-"${adb_awk} '{print \"local-zone: \\042\"\$0\"\\042 always_transparent\"}'"}"
|
||||||
adb_dnssafesearch="${adb_dnssafesearch:-"${adb_awk} -v item=\"\$item\" '{type=\"AAAA\";if(match(item,/^([0-9]{1,3}\.){3}[0-9]{1,3}$/)){type=\"A\"}}{print \"local-data: \\042\"\$0\" \"type\" \"item\"\\042\"}'"}"
|
adb_dnssafesearch="${adb_dnssafesearch:-"${adb_awk} -v item=\"\$item\" '{type=\"AAAA\";if(match(item,/^([0-9]{1,3}\.){3}[0-9]{1,3}$/)){type=\"A\"}}{print \"local-data: \\042\"\$0\" \"type\" \"item\"\\042\"}'"}"
|
||||||
adb_dnsstop="${adb_dnsstop:-"local-zone: \".\" static"}"
|
adb_dnsstop="${adb_dnsstop:-"local-zone: \".\" always_nxdomain"}"
|
||||||
;;
|
;;
|
||||||
"named")
|
"named")
|
||||||
adb_dnscachecmd="$(command -v rndc || printf "%s" "-")"
|
adb_dnscachecmd="$(command -v rndc || printf "%s" "-")"
|
||||||
|
@ -625,7 +625,7 @@ f_dnsup() {
|
||||||
dns_service="$(ubus -S call service list "{\"name\":\"${adb_dns}\"}")"
|
dns_service="$(ubus -S call service list "{\"name\":\"${adb_dns}\"}")"
|
||||||
dns_up="$(printf "%s" "${dns_service}" | jsonfilter -l1 -e "@[\"${adb_dns}\"].instances.*.running")"
|
dns_up="$(printf "%s" "${dns_service}" | jsonfilter -l1 -e "@[\"${adb_dns}\"].instances.*.running")"
|
||||||
dns_pid="$(printf "%s" "${dns_service}" | jsonfilter -l1 -e "@[\"${adb_dns}\"].instances.*.pid")"
|
dns_pid="$(printf "%s" "${dns_service}" | jsonfilter -l1 -e "@[\"${adb_dns}\"].instances.*.pid")"
|
||||||
if [ "${dns_up}" = "true" ] && [ -n "${dns_pid}" ] && ! ls -l "/proc/${dns_pid}/fd" 2>/dev/null | grep -q "${adb_dnsdir}/${adb_dnsfile}"; then
|
if [ "${dns_up}" = "true" ] && [ -n "${dns_pid}" ] && ! ls "/proc/${dns_pid}/fd/${adb_dnsdir}/${adb_dnsfile}" >/dev/null 2>&1; then
|
||||||
if [ -x "${adb_lookupcmd}" ] && [ "${adb_lookupdomain}" != "false" ]; then
|
if [ -x "${adb_lookupcmd}" ] && [ "${adb_lookupdomain}" != "false" ]; then
|
||||||
if "${adb_lookupcmd}" "${adb_lookupdomain}" >/dev/null 2>&1; then
|
if "${adb_lookupcmd}" "${adb_lookupdomain}" >/dev/null 2>&1; then
|
||||||
out_rc="0"
|
out_rc="0"
|
||||||
|
@ -1434,13 +1434,6 @@ else
|
||||||
f_log "err" "system libraries not found"
|
f_log "err" "system libraries not found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# version information
|
|
||||||
#
|
|
||||||
if [ "${adb_action}" = "version" ]; then
|
|
||||||
printf "%s\n" "${adb_ver}"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# awk check
|
# awk check
|
||||||
#
|
#
|
||||||
adb_awk="$(command -v gawk)"
|
adb_awk="$(command -v gawk)"
|
||||||
|
|
|
@ -98,22 +98,22 @@
|
||||||
"descurl": "https://github.com/notracking/hosts-blocklists"
|
"descurl": "https://github.com/notracking/hosts-blocklists"
|
||||||
},
|
},
|
||||||
"oisd_basic": {
|
"oisd_basic": {
|
||||||
"url": "https://dbl.oisd.nl/basic/",
|
"url": "https://dblw.oisd.nl/basic/",
|
||||||
"rule": "/^([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($1)}",
|
"rule": "/^\\*\\.([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($1)}",
|
||||||
"size": "L",
|
"size": "L",
|
||||||
"focus": "general",
|
"focus": "general",
|
||||||
"descurl": "https://oisd.nl"
|
"descurl": "https://oisd.nl"
|
||||||
},
|
},
|
||||||
"oisd_nsfw": {
|
"oisd_nsfw": {
|
||||||
"url": "https://dbl.oisd.nl/nsfw/",
|
"url": "https://dblw.oisd.nl/nsfw/",
|
||||||
"rule": "/^([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($1)}",
|
"rule": "/^\\*\\.([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($1)}",
|
||||||
"size": "XL",
|
"size": "XL",
|
||||||
"focus": "general",
|
"focus": "general",
|
||||||
"descurl": "https://oisd.nl"
|
"descurl": "https://oisd.nl"
|
||||||
},
|
},
|
||||||
"oisd_full": {
|
"oisd_full": {
|
||||||
"url": "https://dbl.oisd.nl",
|
"url": "https://dblw.oisd.nl",
|
||||||
"rule": "/^([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($1)}",
|
"rule": "/^\\*\\.([[:alnum:]_-]{1,63}\\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($1)}",
|
||||||
"size": "XXL",
|
"size": "XXL",
|
||||||
"focus": "general",
|
"focus": "general",
|
||||||
"descurl": "https://oisd.nl"
|
"descurl": "https://oisd.nl"
|
||||||
|
|
Loading…
Reference in a new issue