作者:z494627 | 更新时间:2016-05-02 | 浏览量:2285
我写了updateDnsde lua代码实现,贡献给大家:
local http = require("socket.http") --http ------------此处需修改------------- DNSID="1" --DNS网关ID DNSPWD="123456787" --DNS网关密码 DNSPort="80" --DNS网关端口 while true do if ((os.time() - lastUpdateTime) > 20) then local address=luci.util.ubus("network.interface.wan","status") or {} myipv4=address["ipv4-address"][1]["address"] if(myipv4 ~= myOldIp) then local htpres=http.request("http://www.bigiot.net/Dns/updateDns?id="..DNSID.."\&ip="..myipv4.."\&pw="..DNSPWD.."\&pt="..DNSPort) print(htpres) myOldIp=myipv4 end end