summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-base')
-rw-r--r--modules/luci-base/luasrc/tools/status.lua10
-rw-r--r--modules/luci-base/luasrc/util.lua8
2 files changed, 13 insertions, 5 deletions
diff --git a/modules/luci-base/luasrc/tools/status.lua b/modules/luci-base/luasrc/tools/status.lua
index ac053eac8c..a1ecbe71d0 100644
--- a/modules/luci-base/luasrc/tools/status.lua
+++ b/modules/luci-base/luasrc/tools/status.lua
@@ -48,7 +48,15 @@ local function dhcp_leases_common(family)
fd:close()
end
- local fd = io.open("/tmp/hosts/odhcpd", "r")
+ local lease6file = "/tmp/hosts/odhcpd"
+ uci:foreach("dhcp", "odhcpd",
+ function(t)
+ if t.leasefile and nfs.access(t.leasefile) then
+ lease6file = t.leasefile
+ return false
+ end
+ end)
+ local fd = io.open(lease6file, "r")
if fd then
while true do
local ln = fd:read("*l")
diff --git a/modules/luci-base/luasrc/util.lua b/modules/luci-base/luasrc/util.lua
index d614a6c799..896e36b45f 100644
--- a/modules/luci-base/luasrc/util.lua
+++ b/modules/luci-base/luasrc/util.lua
@@ -640,18 +640,18 @@ function checklib(fullpathexe, wantedlib)
local fs = require "nixio.fs"
local haveldd = fs.access('/usr/bin/ldd')
if not haveldd then
- return -1
+ return false
end
local libs = exec("/usr/bin/ldd " .. fullpathexe)
if not libs then
- return 0
+ return false
end
for k, v in ipairs(split(libs)) do
if v:find(wantedlib) then
- return 1
+ return true
end
end
- return 0
+ return false
end
--