mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-12 18:41:51 +00:00
Get public ip only when needed
This commit is contained in:
parent
c97370d410
commit
c80f9a017a
1 changed files with 4 additions and 4 deletions
|
@ -1373,20 +1373,20 @@ function interfaces_status()
|
|||
if connectivity ~= "ERROR" then
|
||||
if ifname ~= nil and ifname:match("^tun.*") and interface:match("^ovpn.*") then
|
||||
publicIP = uci:get("openmptcprouter",interface:sub(5),"publicip") or ""
|
||||
if ifname ~= nil and publicIP == "" and mArray.openmptcprouter["external_check"] ~= false and mArray.openmptcprouter["dns"] == true then
|
||||
if ifname ~= nil and ipaddr ~= "" and publicIP == "" and mArray.openmptcprouter["external_check"] ~= false and mArray.openmptcprouter["dns"] == true then
|
||||
publicIP = ut.trim(sys.exec("omr-ip-intf " .. get_device(interface:sub(5))))
|
||||
end
|
||||
publicIP6 = uci:get("openmptcprouter",interface:sub(5),"publicip6") or ""
|
||||
if ifname ~= nil and publicIP6 == "" and mArray.openmptcprouter["external_check"] ~= false and mArray.openmptcprouter["dns"] == true then
|
||||
if ifname ~= nil and ip6addr ~= "" and publicIP6 == "" and mArray.openmptcprouter["external_check"] ~= false and mArray.openmptcprouter["dns"] == true then
|
||||
publicIP6 = ut.trim(sys.exec("omr-ip6-intf " .. get_device(interface:sub(5))))
|
||||
end
|
||||
else
|
||||
publicIP = uci:get("openmptcprouter",interface,"publicip") or ""
|
||||
if ifname ~= nil and publicIP == "" and mArray.openmptcprouter["external_check"] ~= false and mArray.openmptcprouter["dns"] == true then
|
||||
if ifname ~= nil and ipaddr ~= "" and publicIP == "" and mArray.openmptcprouter["external_check"] ~= false and mArray.openmptcprouter["dns"] == true then
|
||||
publicIP = ut.trim(sys.exec("omr-ip-intf " .. ifname))
|
||||
end
|
||||
publicIP6 = uci:get("openmptcprouter",interface,"publicip6") or ""
|
||||
if ifname ~= nil and publicIP6 == "" and mArray.openmptcprouter["external_check"] ~= false and mArray.openmptcprouter["dns"] == true then
|
||||
if ifname ~= nil and ip6addr ~= "" and publicIP6 == "" and mArray.openmptcprouter["external_check"] ~= false and mArray.openmptcprouter["dns"] == true then
|
||||
publicIP6 = ut.trim(sys.exec("omr-ip6-intf " .. ifname))
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue