mirror of
https://github.com/openwrt/packages.git
synced 2026-10-13 10:07:40 +04:00
adblock: keep the GeoIP map usable without a local uplink
The map array anchor and the f_fetch call were placed inside the uplink branch, so a WAN interface without a resolvable address left adb_map.jsn empty. That skipped the blocked domain lookup as well and dropped the entire map, not just the local marker. Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
2 files changed
+4
-6
No files matched your search
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=adblock
|
||||
PKG_VERSION:=4.5.6
|
||||
PKG_RELEASE:=4
|
||||
PKG_RELEASE:=5
|
||||
PKG_LICENSE:=GPL-3.0-or-later
|
||||
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
|
||||
|
||||
|
||||
@@ -2393,10 +2393,8 @@ f_report() {
|
||||
cnt="1"
|
||||
network_find_wan iface_v4 && network_get_ipaddr ip_v4 "${iface_v4}"
|
||||
network_find_wan6 iface_v6 && network_get_ipaddr6 ip_v6 "${iface_v6}"
|
||||
if [ -n "${ip_v4}" ] || [ -n "${ip_v6}" ]; then
|
||||
f_fetch
|
||||
printf '%s' ",[{}" >"${map_jsn}"
|
||||
fi
|
||||
f_fetch
|
||||
printf '%s' ",[{}" >"${map_jsn}"
|
||||
for ip in ${ip_v4} ${ip_v6}; do
|
||||
(
|
||||
"${adb_fetchcmd}" ${adb_geoparm} "${adb_geourl}/${ip}" 2>>"${adb_errorlog}" |
|
||||
@@ -2406,7 +2404,7 @@ f_report() {
|
||||
cnt="$((cnt + 1))"
|
||||
done
|
||||
wait
|
||||
if [ -s "${map_jsn}" ] && [ "${cnt}" -lt "45" ]; then
|
||||
if [ "${cnt}" -lt "45" ]; then
|
||||
map_seen=""
|
||||
json_init
|
||||
if json_load_file "${report_jsn}" >/dev/null 2>&1; then
|
||||
|
||||
Reference in new issue
Block a user