|
@@ -18,6 +18,7 @@ local function http_post(event_type, data)
|
|
|
local f = io.popen("curl -s -X POST '" .. cfg.server_url .. "/api/events' -H 'Content-Type: application/json' -d '" .. json .. "'", "r")
|
|
local f = io.popen("curl -s -X POST '" .. cfg.server_url .. "/api/events' -H 'Content-Type: application/json' -d '" .. json .. "'", "r")
|
|
|
local result = f:read("*a")
|
|
local result = f:read("*a")
|
|
|
f:close()
|
|
f:close()
|
|
|
|
|
+ return result
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
-- Validate MAC address (proper format with valid hex)
|
|
-- Validate MAC address (proper format with valid hex)
|
|
@@ -36,8 +37,6 @@ local function is_valid_mac(mac)
|
|
|
if second == 255 then return false end
|
|
if second == 255 then return false end
|
|
|
return true
|
|
return true
|
|
|
end
|
|
end
|
|
|
- return result
|
|
|
|
|
-end
|
|
|
|
|
|
|
|
|
|
local function send_event(event_type, data)
|
|
local function send_event(event_type, data)
|
|
|
log_info("Event: " .. event_type)
|
|
log_info("Event: " .. event_type)
|