luci-app-mosdns: fix DNS leak option does not work

* busybox sed does not support regular expression.
This commit is contained in:
sbwml 2023-10-16 22:45:01 +08:00
parent d708a3edad
commit 95a3ebae6d
3 changed files with 7 additions and 3 deletions

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-mosdns PKG_NAME:=luci-app-mosdns
PKG_VERSION:=1.5.12 PKG_VERSION:=1.5.13
PKG_RELEASE:=1 PKG_RELEASE:=1
LUCI_TITLE:=LuCI Support for mosdns LUCI_TITLE:=LuCI Support for mosdns

View File

@ -123,7 +123,11 @@ init_yaml() {
sed -i "/ecs_remote/d;" $CONF sed -i "/ecs_remote/d;" $CONF
fi fi
# DNS Leak # DNS Leak
[ $dns_leak -eq 1 ] && sed -i "0,/primary: query_is_non_local_ip/s/primary: query_is_non_local_ip/primary: forward_remote_upstream/" $CONF if [ $dns_leak -eq 1 ]; then
sed -i "s/primary: UNDEFINED/primary: forward_remote_upstream/g" $CONF
else
sed -i "s/primary: UNDEFINED/primary: query_is_non_local_ip/g" $CONF
fi
# Cloudflare IP # Cloudflare IP
if [ $cloudflare -eq 1 ]; then if [ $cloudflare -eq 1 ]; then
cloudflare_ip=$(sh $MOSDNS_SCRIPT cloudflare) cloudflare_ip=$(sh $MOSDNS_SCRIPT cloudflare)

View File

@ -153,7 +153,7 @@ plugins:
- tag: fallback - tag: fallback
type: fallback type: fallback
args: args:
primary: query_is_non_local_ip primary: UNDEFINED
secondary: forward_remote_upstream secondary: forward_remote_upstream
threshold: 500 threshold: 500
always_standby: true always_standby: true