summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-adblock-fast/root/usr/libexec/rpcd/luci.adblock-fast
diff options
context:
space:
mode:
authorStan Grishin <stangri@melmac.ca>2024-08-10 13:25:23 -0700
committerGitHub <noreply@github.com>2024-08-10 13:25:23 -0700
commit76f6c1de8bc38f7b4acee9fef027d60962ca20a5 (patch)
treefc4b7780256141500d877c75989ae67138793944 /applications/luci-app-adblock-fast/root/usr/libexec/rpcd/luci.adblock-fast
parent257cfac4257571581bd32430757c94a783d4e1e5 (diff)
parentbd7bee7731a45ee72960562546cc713a03fbfc92 (diff)
Merge pull request #7228 from stangri/master-luci-app-adblock-fast
luci-app-adblock-fast: sync with 1.1.2-3 principal package
Diffstat (limited to 'applications/luci-app-adblock-fast/root/usr/libexec/rpcd/luci.adblock-fast')
-rwxr-xr-xapplications/luci-app-adblock-fast/root/usr/libexec/rpcd/luci.adblock-fast8
1 files changed, 6 insertions, 2 deletions
diff --git a/applications/luci-app-adblock-fast/root/usr/libexec/rpcd/luci.adblock-fast b/applications/luci-app-adblock-fast/root/usr/libexec/rpcd/luci.adblock-fast
index 2f84904c01..222b03619e 100755
--- a/applications/luci-app-adblock-fast/root/usr/libexec/rpcd/luci.adblock-fast
+++ b/applications/luci-app-adblock-fast/root/usr/libexec/rpcd/luci.adblock-fast
@@ -14,7 +14,7 @@
# ubus -S call luci.adblock-fast setInitAction '{"name": "adblock-fast", "action": "pause" }'
# ubus -S call luci.adblock-fast setInitAction '{"name": "adblock-fast", "action": "stop" }'
-readonly luciCompat='1'
+readonly luciCompat='2'
readonly adbFunctionsFile='/etc/init.d/adblock-fast'
if [ -s "$adbFunctionsFile" ]; then
# shellcheck source=../../../../../adblock-fast/files/etc/init.d/adblock-fast
@@ -29,7 +29,10 @@ get_file_url_filesizes() {
local url size
config_get url "$1" 'url'
config_get size "$1" 'size'
- [ -n "$size" ] || size="$(get_url_filesize "$url")"
+ if [ -z "$size" ]; then
+ size="$(get_url_filesize "$url")"
+ uci_set "$name" "$1" 'size' "$size"
+ fi
json_add_object
json_add_string 'url' "$url"
json_add_int 'size' "$size"
@@ -45,6 +48,7 @@ get_file_url_filesizes() {
json_close_object
json_dump
json_cleanup
+ [ -n "$(uci_changes "$name")" ] && uci_commit "$name"
}
get_init_list() {