https-dns-proxy: improve CLI messaging 21633/head
authorStan Grishin <stangri@melmac.ca>
Sun, 23 Jul 2023 05:22:04 +0000 (05:22 +0000)
committerStan Grishin <stangri@melmac.ca>
Sun, 23 Jul 2023 05:24:12 +0000 (05:24 +0000)
Signed-off-by: Stan Grishin <stangri@melmac.ca>
(cherry picked from commit 649fbcf9fcab34df3d39b0642cd5b566eefb569e)

net/https-dns-proxy/Makefile
net/https-dns-proxy/files/https-dns-proxy.init

index ce7d70eeb04ee8e58cbe06d1bdc4e0fb6730b840..ddc43a8920c9e67affcba91a2305da1382f5abcb 100644 (file)
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=https-dns-proxy
 PKG_VERSION:=2023-05-25
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/aarond10/https_dns_proxy/
index d63dad9c56be211cbef91c0b02b13d9df6fd3b93..e403686a6298fe2e55b557325749b5454e38d644 100755 (executable)
@@ -67,7 +67,7 @@ uci_changes() {
        /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} changes "$PACKAGE${CONFIG:+.$CONFIG}${OPTION:+.$OPTION}"
 }
 
-dnsmasq_restart() { [ -x /etc/init.d/dnsmasq ] || return 0; /etc/init.d/dnsmasq restart >/dev/null 2>&1; }
+dnsmasq_restart() { [ -x /etc/init.d/dnsmasq ] || return 1; /etc/init.d/dnsmasq restart >/dev/null 2>&1; }
 
 version() { echo "$PKG_VERSION"; }
 
@@ -223,7 +223,7 @@ start_service() {
        local procd_fw_src_interfaces
 
        local port=5053
-       output "Starting $serviceName "
+       output "Starting $serviceName instances "
        config_load "$packageName"
        config_get_bool canary_domains_icloud  'config' 'canary_domains_icloud' '1'
        config_get_bool canary_domains_mozilla 'config' 'canary_domains_mozilla' '1'
@@ -240,11 +240,21 @@ start_service() {
        dhcp_backup 'create'
        config_load "$packageName"
        config_foreach start_instance "$packageName"
+       output "\\n"
        if [ -n "$(uci_changes dhcp)" ]; then
-               uci_commit 'dhcp'
-               dnsmasq_restart
+               output "Updating dnsmasq config "
+               if uci_commit 'dhcp'; then
+                       output_okn
+               else
+                       output_failn
+               fi
+               output "Restarting dnsmasq "
+               if dnsmasq_restart; then
+                       output_okn
+               else
+                       output_failn
+               fi
        fi
-       output "\\n"
 }
 
 stop_service() {