Skip to content

Commit

Permalink
shared-state-dnsmasq_leases fix single lease add
Browse files Browse the repository at this point in the history
  • Loading branch information
G10h4ck committed Mar 5, 2019
1 parent ca9c598 commit ea0fdf7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/shared-state-dnsmasq_leases/Makefile
Expand Up @@ -19,7 +19,8 @@ define Package/$(PKG_NAME)
CATEGORY:=LiMe
MAINTAINER:=Gioacchino Mazzurco <gio@altermundi.net>
URL:=http://libremesh.org
DEPENDS:=+lua +libuci-lua +luci-lib-jsonc shared-state
DEPENDS:=@(!PACKAGE_dnsmasq-lease-share) +libuci-lua +lua \
+luci-lib-jsonc shared-state
PKGARCH:=all
endef

Expand Down
@@ -1,2 +1,2 @@
#!/bin/sh
lua /usr/bin/shared-state-publish_dnsmasq_leases $@
((/usr/bin/shared-state-publish_dnsmasq_leases $@)&)
Expand Up @@ -32,7 +32,7 @@ function add_lease(client_mac, client_ip, client_hostname, client_id)
leaseData[client_ip] = { hostname=client_hostname, id=client_id,
mac=client_mac }
local cStdin = io.popen("shared-state insert dnsmasq-leases", "w")
cStdin:write(JSON.stringify(leasesTable))
cStdin:write(JSON.stringify(leaseData))
cStdin:close()
end

Expand All @@ -47,6 +47,7 @@ end
local command = arg[1]
local client_mac = arg[2]
local client_ip = arg[3]

local client_hostname
if (arg[4] and (arg[4]:len() > 0)) then client_hostname = arg[4]
else client_hostname = "" end
Expand Down

0 comments on commit ea0fdf7

Please sign in to comment.