simple-adblock: bugfixes for uci_load_validate 21828/head
authorStan Grishin <stangri@melmac.ca>
Tue, 15 Aug 2023 16:31:21 +0000 (16:31 +0000)
committerStan Grishin <stangri@melmac.ca>
Tue, 15 Aug 2023 16:31:28 +0000 (16:31 +0000)
* fix validation for force_dns_port when missing in config
* fix validation for dns_instance when * or - are used

Signed-off-by: Stan Grishin <stangri@melmac.ca>
net/simple-adblock/Makefile
net/simple-adblock/files/simple-adblock.init

index 5037303ec8608f97db0ec16bb20710819e89b8aa..b3820ac818d3c611a210f3e6eed45f24c5a82b8e 100644 (file)
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=simple-adblock
 PKG_VERSION:=1.9.5
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
 PKG_LICENSE:=GPL-3.0-or-later
 
index 25240c8c1080e79c7c4986dc51ce480fedccdd86..ce51af0d79154fd448411ac41867cf6ebcdc0623 100644 (file)
@@ -1393,7 +1393,7 @@ adb_start() {
        fi
        json_add_array firewall
        if [ "$force_dns" -ne 0 ]; then
-               for c in $force_dns_port; do
+               for c in ${force_dns_port/,/ }; do
                        if netstat -tuln | grep LISTEN | grep ":${c}" >/dev/null 2>&1; then
                                json_add_object ""
                                json_add_string type redirect
@@ -1640,7 +1640,7 @@ load_validate_config() {
        uci_load_validate "$packageName" "$packageName" "$1" "${2}${3:+ $3}" \
                'enabled:bool:0' \
                'force_dns:bool:1' \
-               'force_dns_port:list(integer):"53 853"' \
+               'force_dns_port:list(integer):53,853' \
                'parallel_downloads:bool:1' \
                'debug:bool:0' \
                'compressed_cache:bool:0' \
@@ -1661,7 +1661,7 @@ load_validate_config() {
                'procd_boot_wan_timeout:integer:60' \
                'led:or("", "none", file, device, string)' \
                'dns:or("dnsmasq.addnhosts", "dnsmasq.conf", "dnsmasq.ipset", "dnsmasq.nftset", "dnsmasq.servers", "unbound.adb_list"):dnsmasq.servers' \
-               'dns_instance:or(list(integer, string)):0' \
+               'dns_instance:list(or(integer, string)):0' \
                'allowed_domain:list(string)' \
                'allowed_domains_url:list(string)' \
                'blocked_domain:list(string)' \