Skip to content

Commit cd5f13e

Browse files
committed
adblock: update 4.4.4-3
* fixed a typo in the allowlist/blocklist regex * limit the f_switch function to only the suspend/resume actions Signed-off-by: Dirk Brenken <[email protected]>
1 parent 09951a9 commit cd5f13e

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

net/adblock/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
77

88
PKG_NAME:=adblock
99
PKG_VERSION:=4.4.4
10-
PKG_RELEASE:=2
10+
PKG_RELEASE:=3
1111
PKG_LICENSE:=GPL-3.0-or-later
1212
PKG_MAINTAINER:=Dirk Brenken <[email protected]>
1313

net/adblock/files/adblock.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ f_list() {
703703
;;
704704
"blocklist" | "allowlist")
705705
src_name="${mode}"
706-
rset="/^(([[:alnum:]_-]{1,63}\.)*[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower(\$1)}"
706+
rset="/^(([[:alnum:]_-]{1,63}\\.)*[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower(\$1)}"
707707
case "${src_name}" in
708708
"blocklist")
709709
if [ -f "${adb_blocklist}" ]; then
@@ -927,14 +927,14 @@ f_tld() {
927927
# suspend/resume adblock processing
928928
#
929929
f_switch() {
930-
local status entry done="false" mode="${1}"
930+
local status done="false" mode="${1}"
931931

932932
json_init
933933
json_load_file "${adb_rtfile}" >/dev/null 2>&1
934934
json_select "data" >/dev/null 2>&1
935935
json_get_var status "adblock_status"
936936
f_env
937-
if [ "${mode}" = "suspend" ] && [ "${status}" = "enabled" ]; then
937+
if [ "${status}" = "enabled" ] && [ "${mode}" = "suspend" ]; then
938938
if [ "${adb_dnsshift}" = "0" ] && [ -f "${adb_finaldir}/${adb_dnsfile}" ]; then
939939
mv -f "${adb_finaldir}/${adb_dnsfile}" "${adb_backupdir}/${adb_dnsfile}"
940940
printf "%b" "${adb_dnsheader}" >"${adb_finaldir}/${adb_dnsfile}"
@@ -944,26 +944,26 @@ f_switch() {
944944
printf "%b" "${adb_dnsheader}" >"${adb_dnsdir}/${adb_dnsfile}"
945945
done="true"
946946
fi
947-
elif [ "${mode}" = "resume" ] && [ "${status}" = "paused" ]; then
947+
elif [ "${status}" = "paused" ] && [ "${mode}" = "resume" ]; then
948948
if [ "${adb_dnsshift}" = "0" ] && [ -f "${adb_backupdir}/${adb_dnsfile}" ]; then
949949
mv -f "${adb_backupdir}/${adb_dnsfile}" "${adb_finaldir}/${adb_dnsfile}"
950-
f_count "resume" "${adb_finaldir}/${adb_dnsfile}"
950+
f_count "switch" "${adb_finaldir}/${adb_dnsfile}"
951951
done="true"
952952
elif [ "${adb_dnsshift}" = "1" ] && [ ! -L "${adb_finaldir}/${adb_dnsfile}" ]; then
953953
ln -fs "${adb_finaldir}/${adb_dnsfile}" "${adb_dnsdir}/${adb_dnsfile}"
954-
f_count "resume" "${adb_finaldir}/${adb_dnsfile}"
954+
f_count "switch" "${adb_finaldir}/${adb_dnsfile}"
955955
done="true"
956956
fi
957957
fi
958958
if [ "${done}" = "true" ]; then
959959
f_dnsup
960960
f_jsnup "${mode}"
961961
f_log "info" "${mode} adblock service"
962-
f_rmtemp
963962
else
964-
f_jsnup "stopped"
965-
f_rmdns
963+
f_count "switch" "${adb_finaldir}/${adb_dnsfile}"
964+
f_jsnup "${status}"
966965
fi
966+
f_rmtemp
967967
}
968968

969969
# query blocklist for certain (sub-)domains

0 commit comments

Comments
 (0)