Sfoglia il codice sorgente

luci: auto disable dns redirect for some firmware

Nick Peng 3 anni fa
parent
commit
822f02bab9

+ 1 - 1
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

+ 4 - 0
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
 }