mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-15 03:51:51 +00:00
DNS check
This commit is contained in:
parent
9a66b3b594
commit
b26c636f0d
2 changed files with 13 additions and 2 deletions
|
@ -190,6 +190,13 @@ function interfaces_status()
|
||||||
-- wanaddr
|
-- wanaddr
|
||||||
mArray.openmptcprouter["wan_addr"] = sys.exec("wget -4 -qO- -T 1 http://ip.openmptcprouter.com")
|
mArray.openmptcprouter["wan_addr"] = sys.exec("wget -4 -qO- -T 1 http://ip.openmptcprouter.com")
|
||||||
|
|
||||||
|
-- dns
|
||||||
|
mArray.openmptcprouter["dns"] = false
|
||||||
|
local dns_test = sys.exec("dig openmptcprouter.com | grep 'ANWER: 0'")
|
||||||
|
if dns_test == "" then
|
||||||
|
mArray.openmptcprouter["dns"] = true
|
||||||
|
end
|
||||||
|
|
||||||
mArray.openmptcprouter["remote_addr"] = luci.http.getenv("REMOTE_ADDR") or ""
|
mArray.openmptcprouter["remote_addr"] = luci.http.getenv("REMOTE_ADDR") or ""
|
||||||
mArray.openmptcprouter["remote_from_lease"] = false
|
mArray.openmptcprouter["remote_from_lease"] = false
|
||||||
local leases=tools.dhcp_leases()
|
local leases=tools.dhcp_leases()
|
||||||
|
|
|
@ -111,11 +111,15 @@
|
||||||
}
|
}
|
||||||
if (mArray.openmptcprouter.wan_addr == "")
|
if (mArray.openmptcprouter.wan_addr == "")
|
||||||
{
|
{
|
||||||
statusMessage += 'No VPS IP address, No WAN IP address';
|
statusMessage += 'No VPS IP address, No WAN IP address<br/>';
|
||||||
|
}
|
||||||
|
if (mArray.openmptcprouter.dns == false)
|
||||||
|
{
|
||||||
|
statusMessage += 'DNS issue: can\'t resolve hostname<br/>';
|
||||||
}
|
}
|
||||||
if (mArray.openmptcprouter.ss_addr == "")
|
if (mArray.openmptcprouter.ss_addr == "")
|
||||||
{
|
{
|
||||||
statusMessage += 'ShadowSocks not working';
|
statusMessage += 'ShadowSocks not working<br/>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(statusMessage !== "")
|
if(statusMessage !== "")
|
||||||
|
|
Loading…
Reference in a new issue