mirror of https://github.com/aredn/aredn.git
Refresh LQM's hostname periodically
This commit is contained in:
parent
5cf089e96c
commit
701b2afa3c
|
@ -501,6 +501,12 @@ function lqm()
|
||||||
dtdlinks[track.mac] = {}
|
dtdlinks[track.mac] = {}
|
||||||
track.exposed = false
|
track.exposed = false
|
||||||
|
|
||||||
|
-- Refresh the hostname periodically as it can change
|
||||||
|
local hostname = nixio.getnameinfo(track.ip)
|
||||||
|
if hostname then
|
||||||
|
track.hostname = canonical_hostname(hostname)
|
||||||
|
end
|
||||||
|
|
||||||
local raw = io.popen("/usr/bin/curl --retry 0 --connect-timeout " .. connect_timeout .. " --speed-time " .. speed_time .. " --speed-limit " .. speed_limit .. " -s \"http://" .. track.ip .. ":8080/cgi-bin/sysinfo.json?link_info=1&lqm=1\" -o - 2> /dev/null")
|
local raw = io.popen("/usr/bin/curl --retry 0 --connect-timeout " .. connect_timeout .. " --speed-time " .. speed_time .. " --speed-limit " .. speed_limit .. " -s \"http://" .. track.ip .. ":8080/cgi-bin/sysinfo.json?link_info=1&lqm=1\" -o - 2> /dev/null")
|
||||||
local info = luci.jsonc.parse(raw:read("*a"))
|
local info = luci.jsonc.parse(raw:read("*a"))
|
||||||
raw:close()
|
raw:close()
|
||||||
|
|
Loading…
Reference in New Issue