summaryrefslogtreecommitdiffstats
path: root/config/update_device.lua
blob: cb575e9b415e25446982571490ff925a64616046 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-- This is the script run after editing a device - the label, classes
local functions, device, olddevice, params, oldparams = ...

--functions.logevent("got to update_device script")

-- We'll handle the changing of the device by handling the resulting changing of the params
local f
local env = {}
setmetatable (env, {__index = _G})
local IS_52_LOAD = pcall(load, '')
if IS_52_LOAD then
	local f = loadfile("/etc/provisioning/update_device_params.lua", "bt", env)
else
	-- loadfile loads into the global environment
	-- so we set env 0, not env 1
	setfenv (0, env)
	local f = loadfile("/etc/provisioning/update_device_params.lua")
	setfenv (0, _G)
end
if (f) then f(functions, params, oldparams) end