projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
605d1f1
)
luci-base: read odhcpd leasefile location via uci
author
Hannu Nyman
<
[email protected]
>
Sun, 17 Apr 2016 09:10:24 +0000
(12:10 +0300)
committer
Hannu Nyman
<
[email protected]
>
Mon, 18 Apr 2016 17:43:49 +0000
(20:43 +0300)
Check the location of the odhcpd leasefile from /etc/config/dhcp
via uci. Fallback to the default location.
This fixes #702
Signed-off-by: Hannu Nyman <
[email protected]
>
(cherry picked from commit
51a7f96877d8c5bf70217073ed8aa7ab6a196d20
)
modules/luci-base/luasrc/tools/status.lua
patch
|
blob
|
history
diff --git
a/modules/luci-base/luasrc/tools/status.lua
b/modules/luci-base/luasrc/tools/status.lua
index 0dd092c6df42e8681df6911c2074495791efe894..1e6e69c5d0a7b066bc4bf2d24a978c9515ea92f4 100644
(file)
--- 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")