summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-adblock-fast/root/usr/libexec
diff options
context:
space:
mode:
authorStan Grishin <stangri@melmac.ca>2023-12-06 03:08:08 -0700
committerGitHub <noreply@github.com>2023-12-06 03:08:08 -0700
commit576fd044b95f13b162da7f4ed2855f78c6efce4b (patch)
tree18b300437615416384ff3ce027d7e0a993661faf /applications/luci-app-adblock-fast/root/usr/libexec
parentc0c37903f2276224c246c2a5ba0fb2732ba0e18a (diff)
parent8db9af146acc0e4d5a0aa026636943d3f28468f2 (diff)
Merge pull request #6742 from stangri/master-luci-app-adblock-fast
luci-app-adblock-fast: update to 1.1.0-1
Diffstat (limited to 'applications/luci-app-adblock-fast/root/usr/libexec')
-rwxr-xr-xapplications/luci-app-adblock-fast/root/usr/libexec/rpcd/luci.adblock-fast35
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