{# clientdetails.html : Provides details about client devices discovered by Noddos Copyright (C) 2017 Steven Hessing (steven.hessing@gmail.com) This is free software, licensed under the GNU General Public License v3. #} {% local os = require "os" local cjson = require "cjson" local params = {} local echo = {} local macaddress = ngx.var.arg_mac local profile = {} local device = {} io.input("/var/lib/noddos/DeviceDump.json") local t = io.read("*all") local devices = cjson.decode(t) for i, v in ipairs(devices) do if v.MacAddress == macaddress then device = v end end io.input("/var/lib/noddos/DeviceProfiles.json") t = io.read("*all") local profiles = cjson.decode(t) for i, v in ipairs(profiles) do if device.DeviceProfileUuid == v.DeviceProfileUuid then profile = v end end %}