From 8d8ca1c6aace056dbcf4216ca797902c0099c2fb Mon Sep 17 00:00:00 2001 From: Stan Grishin Date: Fri, 15 Dec 2023 02:47:28 +0000 Subject: luci-app-adblock-fast: update to 1.1.1-1 * Final (hopefully) attempt to avoid errors if dhcp/smartdns configs are missing * New user experience for picking dnsmasq/smartdns instances to enable the adblocking on * use function from init script to set up output paths * update paths to run-time files in ACL Signed-off-by: Stan Grishin --- .../root/usr/libexec/rpcd/luci.adblock-fast | 45 +++------------------- 1 file changed, 5 insertions(+), 40 deletions(-) (limited to 'applications/luci-app-adblock-fast/root/usr/libexec/rpcd') 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 9ca94c7878..63c50c403d 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 @@ -95,7 +95,7 @@ get_init_status() { local name name="$(basename "$1")" name="${name:-$packageName}" - local errors warnings ports dns outputFile outputCache outputGzip + local errors warnings ports dns outputFile outputCache outputGzip outputConfig local i j # shellcheck disable=SC2034 local compressed_cache_dir @@ -106,46 +106,11 @@ get_init_status() { if [ -n "$(uci_get "$packageName" 'config' 'dnsmasq_config_file_url')" ]; then dns="dnsmasq.conf" else - dns="$(uci_get "$packageName" 'config' 'dns')" + dns="$(uci_get "$packageName" 'config' 'dns' 'dnsmasq.servers')" fi - case "$dns" in - dnsmasq.addnhosts) - outputFile="$dnsmasqAddnhostsFile" - outputCache="$dnsmasqAddnhostsCache" - outputGzip="${compressed_cache_dir}/${dnsmasqAddnhostsGzip}" - ;; - dnsmasq.conf) - outputFile="$dnsmasqConfFile" - outputCache="$dnsmasqConfCache" - outputGzip="${compressed_cache_dir}/${dnsmasqConfGzip}" - ;; - dnsmasq.ipset) - outputFile="$dnsmasqIpsetFile" - outputCache="$dnsmasqIpsetCache" - outputGzip="${compressed_cache_dir}/${dnsmasqIpsetGzip}" - ;; - dnsmasq.nftset) - outputFile="$dnsmasqNftsetFile" - outputCache="$dnsmasqNftsetCache" - outputGzip="${compressed_cache_dir}/${dnsmasqNftsetGzip}" - ;; - dnsmasq.servers) - outputFile="$dnsmasqServersFile" - 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" - outputGzip="${compressed_cache_dir}/${unboundGzip}" - ;; - esac + + dns_set_output_values "$dns" + json_init json_add_object "$name" json_add_boolean 'enabled' "$(is_enabled "$name")" -- cgit v1.2.3