diff options
author | Stan Grishin <stangri@melmac.ca> | 2023-12-05 08:26:34 +0000 |
---|---|---|
committer | Stan Grishin <stangri@melmac.ca> | 2023-12-05 08:26:34 +0000 |
commit | 8db9af146acc0e4d5a0aa026636943d3f28468f2 (patch) | |
tree | 9a2c4cd2245c2edec630e15ed836341928b7a924 /applications/luci-app-adblock-fast/root/usr/libexec/rpcd | |
parent | b3d1d056f471f82ffc931a5cffef125ce36b6d41 (diff) |
luci-app-adblock-fast: update to 1.1.0-1
Signed-off-by: Stan Grishin <stangri@melmac.ca>
Diffstat (limited to 'applications/luci-app-adblock-fast/root/usr/libexec/rpcd')
-rwxr-xr-x | applications/luci-app-adblock-fast/root/usr/libexec/rpcd/luci.adblock-fast | 35 |
1 files changed, 24 insertions, 11 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 1285bb80e8..699b286d84 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 @@ -73,13 +73,18 @@ set_init_action() { fi case $action in enable) - cmd="uci -q set ${name}.config.enabled=1 && uci commit $name";; + cmd="/etc/init.d/${name} ${action}" + cmd="${cmd} && uci_set ${name} config enabled 1 && uci_commit $name" + ;; disable) - cmd="uci -q set ${name}.config.enabled=0 && uci commit $name";; + cmd="/etc/init.d/${name} ${action}" + cmd="${cmd} && uci_set ${name} config enabled 0 && uci_commit $name" + ;; start|stop|reload|restart|dl|pause) - cmd="/etc/init.d/${name} ${action}";; + cmd="/etc/init.d/${name} ${action}" + ;; esac - if [ -n "$cmd" ] && eval "${cmd}" >/dev/null 2>&1; then + if [ -n "$cmd" ] && eval "$cmd" >/dev/null 2>&1; then print_json_bool "result" '1' else print_json_bool "result" '0' @@ -96,15 +101,12 @@ get_init_status() { local compressed_cache_dir config_load "$name" config_get compressed_cache_dir 'config' 'compressed_cache_dir' '/etc' - if [ -n "$(sanitize_dir "$compressed_cache_dir")" ]; then - compressed_cache_dir="$(sanitize_dir "$compressed_cache_dir")" - else - compressed_cache_dir="/etc" - fi - if [ -n "$(uci -q get $packageName.config.dnsmasq_config_file_url)" ]; then + compressed_cache_dir="$(sanitize_dir "$compressed_cache_dir")" + compressed_cache_dir="${compressed_cache_dir:-/etc}" + if [ -n "$(uci_get "$packageName" 'config' 'dnsmasq_config_file_url')" ]; then dns="dnsmasq.conf" else - dns="$(uci -q get $packageName.config.dns)" + dns="$(uci_get "$packageName" 'config' 'dns')" fi case "$dns" in dnsmasq.addnhosts) @@ -132,6 +134,12 @@ get_init_status() { outputCache="$dnsmasqServersCache" outputGzip="${compressed_cache_dir}/${dnsmasqServersGzip}" ;; + smartdns.domainset) + outputFilter="$smartdnsDomainSetFilter" + outputFile="$smartdnsDomainSetFile" + outputCache="$smartdnsDomainSetCache" + outputGzip="${compressed_cache_dir}/${smartdnsDomainSetGzip}" + ;; unbound.adb_list) outputFile="$unboundFile" outputCache="$unboundCache" @@ -243,6 +251,11 @@ get_platform_support() { else json_add_boolean 'dnsmasq_installed' '0' fi + if check_smartdns; then + json_add_boolean 'smartdns_installed' '1' + else + json_add_boolean 'smartdns_installed' '0' + fi if check_unbound; then json_add_boolean 'unbound_installed' '1' else |