Skip to content

Commit 219a719

Browse files
committed
better uci_changes
1 parent 5b78c6e commit 219a719

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

files/etc/init.d/https-dns-proxy

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ uci_changes() {
8383
local PACKAGE="$1"
8484
local CONFIG="$2"
8585
local OPTION="$3"
86-
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} changes "$PACKAGE${CONFIG:+.$CONFIG}${OPTION:+.$OPTION}"
86+
[ -s "${UCI_CONFIG_DIR:-/etc/config/}${PACKAGE}" ] && \
87+
[ -n "$(/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} changes "$PACKAGE${CONFIG:+.$CONFIG}${OPTION:+.$OPTION}")" ]
8788
}
8889
version() { echo "$PKG_VERSION"; }
8990

@@ -306,7 +307,7 @@ start_service() {
306307
config_load "$packageName"
307308
config_foreach start_instance "$packageName" "$param"
308309
output "\\n"
309-
if [ -n "$(uci_changes dhcp)" ]; then
310+
if uci_changes 'dhcp'; then
310311
output "Updating dnsmasq config "
311312
if uci_commit 'dhcp'; then
312313
output_okn
@@ -344,7 +345,7 @@ stop_service() {
344345
canaryDomains="${canaryDomains:+$canaryDomains }${canaryDomainsMozilla}"
345346
fi
346347
dhcp_backup 'restore'
347-
if [ -n "$(uci_changes dhcp)" ]; then
348+
if uci_changes 'dhcp'; then
348349
uci_commit 'dhcp'
349350
dnsmasq_restart || s=1
350351
fi

0 commit comments

Comments
 (0)