Update smartdns.lua (#1092)

luci-compat: fix dnsmasq redirect status
This commit is contained in:
HiGarfield
2022-09-28 09:22:51 +08:00
committed by GitHub
parent 799d19f233
commit a13433abac

View File

@@ -38,7 +38,7 @@ end
function act_status()
local e={}
local ipv6_server;
local dnsmasq_server = luci.sys.exec("uci get dhcp.@dnsmasq[0].server")
local dnsmasq_server = smartdns.get_config_option("dhcp", "dnsmasq", "server", {nil})[1]
local auto_set_dnsmasq = smartdns.get_config_option("smartdns", "smartdns", "auto_set_dnsmasq", nil);
e.auto_set_dnsmasq = auto_set_dnsmasq
@@ -47,7 +47,7 @@ function act_status()
if e.local_port ~= nil and e.local_port ~= "53" and auto_set_dnsmasq ~= nil and auto_set_dnsmasq == "1" then
local str;
str = "127.0.0.1#" .. e.local_port
if string.sub(dnsmasq_server,1,string.len(str)) ~= str then
if dnsmasq_server ~= str then
e.dnsmasq_redirect_failure = 1
end
end