aboutsummaryrefslogtreecommitdiff
path: root/net/adblock-fast/files/etc
diff options
context:
space:
mode:
authorStan Grishin <stangri@melmac.ca>2023-10-21 02:26:02 +0000
committerStan Grishin <stangri@melmac.ca>2023-10-21 02:27:54 +0000
commit42cc50eec890b2f86c5f9573938051149a62321d (patch)
treeec35c29aef31d4ee157109897da52f799902e2be /net/adblock-fast/files/etc
parentbfb980f18ee2eddf47b04c3d92b97b6580966cde (diff)
adblock-fast: bugfix: allow command
* fix sed to properly purge allowed domains from block-lists * ensure resolver is restarted on allow command * reduce pause default/max in attempt to make it work with luci Signed-off-by: Stan Grishin <stangri@melmac.ca>
Diffstat (limited to 'net/adblock-fast/files/etc')
-rw-r--r--net/adblock-fast/files/etc/config/adblock-fast1
-rwxr-xr-xnet/adblock-fast/files/etc/init.d/adblock-fast11
2 files changed, 7 insertions, 5 deletions
diff --git a/net/adblock-fast/files/etc/config/adblock-fast b/net/adblock-fast/files/etc/config/adblock-fast
index f459411f0..e55475dd1 100644
--- a/net/adblock-fast/files/etc/config/adblock-fast
+++ b/net/adblock-fast/files/etc/config/adblock-fast
@@ -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'
diff --git a/net/adblock-fast/files/etc/init.d/adblock-fast b/net/adblock-fast/files/etc/init.d/adblock-fast
index 8229f0845..57fe5b932 100755
--- a/net/adblock-fast/files/etc/init.d/adblock-fast
+++ b/net/adblock-fast/files/etc/init.d/adblock-fast
@@ -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' \