parent
d031929593
commit
7c7dbb0e62
@ -81,7 +81,7 @@ function domainToIPv4(domain, dns)
|
|||||||
local Dns = dns or "223.5.5.5"
|
local Dns = dns or "223.5.5.5"
|
||||||
local IPs = luci.sys.exec('nslookup %s %s | awk \'/^Name:/{getline; if ($1 == "Address:") print $2}\'' % { domain, Dns })
|
local IPs = luci.sys.exec('nslookup %s %s | awk \'/^Name:/{getline; if ($1 == "Address:") print $2}\'' % { domain, Dns })
|
||||||
for IP in string.gmatch(IPs, "%S+") do
|
for IP in string.gmatch(IPs, "%S+") do
|
||||||
if not datatypes.ip6addr(IP) then return IP end
|
if datatypes.ipaddr(IP) and not datatypes.ip6addr(IP) then return IP end
|
||||||
end
|
end
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user