diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-04-05 09:25:00 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-07-07 15:36:25 +0200 |
commit | bfae09e5740a09ca910d971893cbdc368a7fe01e (patch) | |
tree | 2c354380d5b486ad4e85a19f3fc7eb1289f4303f /modules/luci-base/root/usr/libexec | |
parent | a31dc6f3c1524f05a6aac2970b61b0e84628475c (diff) |
luci-base: implement lease status ubus call
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/root/usr/libexec')
-rwxr-xr-x | modules/luci-base/root/usr/libexec/rpcd/luci | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/luci-base/root/usr/libexec/rpcd/luci b/modules/luci-base/root/usr/libexec/rpcd/luci index d668e789fb..c4566210f6 100755 --- a/modules/luci-base/root/usr/libexec/rpcd/luci +++ b/modules/luci-base/root/usr/libexec/rpcd/luci @@ -178,6 +178,24 @@ local methods = { end return result end + }, + + leases = { + args = { family = 0 }, + call = function(args) + local s = require "luci.tools.status" + + if args.family == 4 then + return { dhcp_leases = s.dhcp_leases() } + elseif args.family == 6 then + return { dhcp6_leases = s.dhcp6_leases() } + else + return { + dhcp_leases = s.dhcp_leases(), + dhcp6_leases = s.dhcp6_leases() + } + end + end } } |