luci-app-adguardhome: fix ver display
This commit is contained in:
parent
9506f4b197
commit
ad8c278f1e
@ -37,8 +37,8 @@ else
|
||||
local version=uci:get("AdGuardHome","AdGuardHome","version")
|
||||
local testtime=fs.stat(binpath,"mtime")
|
||||
if testtime~=tonumber(binmtime) or version==nil then
|
||||
local tmp=luci.sys.exec(binpath.." -c /dev/null --check-config 2>&1| grep -m 1 -E 'v[0-9.]+' -o")
|
||||
version=string.sub(tmp, 1, -2)
|
||||
local tmp=luci.sys.exec(binpath.." -c /dev/null --check-config 2>&1| grep -m 1 -E '(version |v)[0-9.]+' -o")
|
||||
version=string.sub(tmp, -7)
|
||||
if version=="" then version="core error" end
|
||||
uci:set("AdGuardHome","AdGuardHome","version",version)
|
||||
uci:set("AdGuardHome","AdGuardHome","binmtime",testtime)
|
||||
@ -301,4 +301,4 @@ function m.on_commit(map)
|
||||
uci:save("AdGuardHome")
|
||||
end
|
||||
end
|
||||
return m
|
||||
return m
|
||||
|
||||
Loading…
Reference in New Issue
Block a user