mirror of
https://github.com/openwrt/packages.git
synced 2026-12-04 11:15:36 +04:00
dnsproxy: migrate old options
Migrate "all_servers" and "fastest_addr" to new option "upstream_mode".
Fixes: d0823a8244 ("dnsproxy: Update to 0.73.2")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
1 parent
0c43aa3127
commit
67b79fbc77
4 files changed
+16
-7
No files matched your search
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dnsproxy
|
||||
PKG_VERSION:=0.73.2
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/AdguardTeam/dnsproxy/tar.gz/v$(PKG_VERSION)?
|
||||
|
||||
@@ -7,8 +7,6 @@ config dnsproxy 'global'
|
||||
list listen_addr '::1'
|
||||
list listen_port '5353'
|
||||
option log_file ''
|
||||
option all_servers '0'
|
||||
option fastest_addr '0'
|
||||
option http3 '0'
|
||||
option insecure '0'
|
||||
option ipv6_disabled '0'
|
||||
@@ -17,6 +15,7 @@ config dnsproxy 'global'
|
||||
option rate_limit ''
|
||||
option refuse_any '0'
|
||||
option udp_buf_size ''
|
||||
option upstream_mode ''
|
||||
option verbose '0'
|
||||
|
||||
config dnsproxy 'bogus_nxdomain'
|
||||
|
||||
@@ -2,7 +2,18 @@
|
||||
|
||||
[ -s "/etc/config/dnsproxy" ] || exit 0
|
||||
|
||||
#Migrate options 'listen_addr' 'listen_port' to list type
|
||||
# Migrate options 'listen_addr' 'listen_port' to list type
|
||||
sed -i -e "s,option listen_addr,list listen_addr,g" \
|
||||
-e "s,option listen_port,list listen_port,g" "/etc/config/dnsproxy"
|
||||
|
||||
# Migrate 'all_servers' and 'fastest_addr' to 'upstream_mode'
|
||||
if [ "$(uci -q get "dnsproxy.global.all_servers")" = "1" ]; then
|
||||
uci -q set "dnsproxy.global.upstream_mode"="parallel"
|
||||
elif [ "$(uci -q get "dnsproxy.global.fastest_addr")" = "1" ]; then
|
||||
uci -q set "dnsproxy.global.upstream_mode"="fastest_addr"
|
||||
fi
|
||||
uci -q delete "dnsproxy.global.all_servers"
|
||||
uci -q delete "dnsproxy.global.fastest_addr"
|
||||
uci -q commit "dnsproxy"
|
||||
|
||||
exit 0
|
||||
@@ -42,8 +42,6 @@ append_param_bool() {
|
||||
}
|
||||
|
||||
load_config_arg() {
|
||||
append_param_bool "$1" "all_servers"
|
||||
append_param_bool "$1" "fastest_addr"
|
||||
append_param_bool "$1" "http3"
|
||||
append_param_bool "$1" "insecure"
|
||||
append_param_bool "$1" "ipv6_disabled"
|
||||
@@ -82,10 +80,11 @@ load_config_list() {
|
||||
|
||||
load_config_param() {
|
||||
append_param_arg "global" "log_file" "--output"
|
||||
append_param_arg "global" "timeout" "--timeout"
|
||||
append_param_arg "global" "max_go_routines" "--max-go-routines"
|
||||
append_param_arg "global" "rate_limit" "--ratelimit"
|
||||
append_param_arg "global" "timeout" "--timeout"
|
||||
append_param_arg "global" "udp_buf_size" "--udp-buf-size"
|
||||
append_param_arg "global" "upstream_mode" "--upstream-mode"
|
||||
|
||||
append_param_arg "hosts" "enabled" "--hosts-file-enabled" "0"
|
||||
|
||||
|
||||
Reference in new issue
Block a user