Skip to content

Commit

Permalink
fix(uci/migration): fix commit changes
Browse files Browse the repository at this point in the history
  • Loading branch information
1715173329 authored Apr 2, 2024
1 parent 0d2f0d8 commit 2ac9841
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions root/etc/uci-defaults/luci-homeproxy-migration
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2ac9841

Please sign in to comment.