1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-17 12:53:54 +02:00

Merge pull request #22464 from stangri/master-adblock-fast

adblock-fast: bugfix: allow command
This commit is contained in:
Stan Grishin 2023-10-21 07:35:47 -06:00 committed by GitHub
commit 99b3b46abc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

View File

@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=adblock-fast
PKG_VERSION:=1.0.0
PKG_RELEASE:=6
PKG_RELEASE:=7
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
PKG_LICENSE:=GPL-3.0-or-later

View File

@ -29,6 +29,7 @@ config adblock-fast 'config'
# list force_dns_port '8443'
option led 'none'
option parallel_downloads '1'
option pause_timeout '20'
option procd_trigger_wan6 '0'
option procd_boot_wan_timeout '60'
option verbosity '2'

View File

@ -1155,7 +1155,7 @@ adb_allow() {
for c in $string; do
output 2 " $c "
hf="$(echo "$c" | sed 's/\./\\./g')"
if sed -i "/\(^\|\.\)${hf}$/d;" "$outputFile" && \
if sed -i "\:\(/\|\.\)${hf}/:d" "$outputFile" && \
uci_add_list_if_new "${packageName}" 'config' 'allowed_domain' "$c"; then
output_ok
else
@ -1171,7 +1171,7 @@ adb_allow() {
fi
fi
output 2 "Committing changes to config "
if [ -n "$(uci_changes "$packageName")" ] && uci_commit "$packageName"; then
if uci_commit "$packageName"; then
allowed_domain="$(uci_get "$packageName" 'config' 'allowed_domain')"
json set triggers
json set stats "$serviceName is blocking $(wc -l < "$outputFile") domains (with ${dns})"
@ -1196,7 +1196,8 @@ adb_allow() {
output 2 "Allowing domain(s) \\n"
for c in $string; do
output 2 " $c "
if sed -i "/${string}/d" "$outputFile" && \
hf="$(echo "$c" | sed 's/\./\\./g')"
if sed -i "\:\(\"\|\.\)${hf}\":d" "$outputFile" && \
uci_add_list_if_new "$packageName" 'config' 'allowed_domain' "$string"; then
output_ok
else
@ -1212,7 +1213,7 @@ adb_allow() {
fi
fi
output 2 "Committing changes to config "
if [ -n "$(uci_changes "$packageName")" ] && uci_commit "$packageName"; then
if uci_commit "$packageName"; then
allowed_domain="$(uci_get "$packageName" 'config' 'allowed_domain')"
json set triggers
json set stats "$serviceName is blocking $(wc -l < "$outputFile") domains (with ${dns})"
@ -1725,7 +1726,7 @@ load_validate_config() {
'config_update_enabled:bool:0' \
'config_update_url:string:https://cdn.jsdelivr.net/gh/openwrt/packages/net/adblock-fast/files/adblock-fast.conf.update' \
'download_timeout:range(1,60):20' \
'pause_timeout:range(10,120):60' \
'pause_timeout:range(1,60):20' \
'curl_additional_param:or("", string)' \
'curl_max_file_size:or("", uinteger)' \
'curl_retry:range(0,30):3' \