From 2ac9841e894d78e84cf5d6e1763ad04708c141e0 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 2 Apr 2024 14:45:51 +0800 Subject: [PATCH] fix(uci/migration): fix commit changes --- root/etc/uci-defaults/luci-homeproxy-migration | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/root/etc/uci-defaults/luci-homeproxy-migration b/root/etc/uci-defaults/luci-homeproxy-migration index a31c62f7..43f7e5a2 100644 --- a/root/etc/uci-defaults/luci-homeproxy-migration +++ b/root/etc/uci-defaults/luci-homeproxy-migration @@ -2,14 +2,15 @@ china_dns_server="$(uci -q get "homeproxy.config.china_dns_server")" if [ "$china_dns_server" = "wan_114" ]; then - uci -q delete homeproxy.config.china_dns_server + uci -q delete "homeproxy.config.china_dns_server" uci -q add_list "homeproxy.config.china_dns_server"="wan" uci -q add_list "homeproxy.config.china_dns_server"="114.114.114.114" elif echo "$china_dns_server" | grep -q ","; then - uci -q delete homeproxy.config.china_dns_server + uci -q delete "homeproxy.config.china_dns_server" for dns in ${china_dns_server//,/ }; do uci -q add_list "homeproxy.config.china_dns_server"="$dns" done fi +[ -z "$(uci -q changes "homeproxy")" ] || uci -q commit "homeproxy" exit 0