From 822f02bab9f1607395ba8f4f113865bd56f99dcf Mon Sep 17 00:00:00 2001 From: Nick Peng Date: Thu, 1 Sep 2022 20:00:31 +0800 Subject: [PATCH] luci: auto disable dns redirect for some firmware --- package/luci-compat/control/control | 2 +- package/openwrt/files/etc/init.d/smartdns | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package/luci-compat/control/control b/package/luci-compat/control/control index e0feefc..dce8895 100644 --- a/package/luci-compat/control/control +++ b/package/luci-compat/control/control @@ -1,6 +1,6 @@ Package: luci-app-smartdns Version: git-18.201.27126-7bf0367-1 -Depends: libc, smartdns +Depends: libc, smartdns, luci-compat Source: feeds/luci/applications/luci-app-smartdns Section: luci Architecture: all diff --git a/package/openwrt/files/etc/init.d/smartdns b/package/openwrt/files/etc/init.d/smartdns index 28fc67e..9bfb3bf 100644 --- a/package/openwrt/files/etc/init.d/smartdns +++ b/package/openwrt/files/etc/init.d/smartdns @@ -96,6 +96,10 @@ set_main_dns() uci -q set dhcp.@dnsmasq[0].port=0 uci -q set dhcp.lan.dhcp_option="6,$hostip" + # for some third-party firmware + redir_dns="$(uci -q get dhcp.@dnsmasq[0].dns_redirect)" + [ "$redir_dns" = "1" ] && uci -q set dhcp.@dnsmasq[0].dns_redirect=0 + uci commit dhcp /etc/init.d/dnsmasq restart }