summaryrefslogtreecommitdiffstats
path: root/config/update_device_params.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2013-10-27 01:59:54 +0000
committerTed Trask <ttrask01@yahoo.com>2013-10-27 01:59:54 +0000
commit89f1e294752c899ebdba06a6fbcfbcc390ecc807 (patch)
tree9fe02b61b8aef8d4d088762d1aae73179c5305fb /config/update_device_params.lua
parent148d568b3db38ada9cf0c5085d2c71584d588598 (diff)
downloadacf-provisioning-89f1e294752c899ebdba06a6fbcfbcc390ecc807.tar.bz2
acf-provisioning-89f1e294752c899ebdba06a6fbcfbcc390ecc807.tar.xz
Pass logevent function to scripts
Diffstat (limited to 'config/update_device_params.lua')
-rw-r--r--config/update_device_params.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/config/update_device_params.lua b/config/update_device_params.lua
index c5ec144..ee7034a 100644
--- a/config/update_device_params.lua
+++ b/config/update_device_params.lua
@@ -5,7 +5,7 @@ posix = require("posix")
local root = "/var/www/provisioning/htdocs/"
---APP.logevent("got to update_device_params script")
+--functions.logevent("got to update_device_params script")
local function findip(mac)
if not mac or mac == "" then
@@ -20,10 +20,10 @@ end
local notify_device = function(mac, extension)
local ipaddr = findip(mac)
if ipaddr then
- --APP.logevent("Notifying "..ipaddr.." to update for "..(mac or ""))
+ --functions.logevent("Notifying "..ipaddr.." to update for "..(mac or ""))
os.execute("/etc/provisioning/notify_device "..ipaddr.." "..extension)
else
- --APP.logevent("Warning - could not find IP address for "..(mac or ""))
+ --functions.logevent("Warning - could not find IP address for "..(mac or ""))
end
end
@@ -34,10 +34,10 @@ if oldparams.value.device and oldparams.value.device.value.mac and oldparams.val
if string.match(oldparams.value.device.label, "Polycom") and string.match(oldparams.value.device.value.mac.value, "[1-9A-F]") then
local deletefiles = true
if string.match(params.value.device.value.mac.value, "[1-9A-F]") then
- --APP.logevent("Moving files for "..oldparams.value.device.value.mac.value)
+ --functions.logevent("Moving files for "..oldparams.value.device.value.mac.value)
deletefiles = false
else
- --APP.logevent("Deleting files for "..oldparams.value.device.value.mac.value)
+ --functions.logevent("Deleting files for "..oldparams.value.device.value.mac.value)
end
local path = root.."Polycom/"
if posix.stat(path, "type") == "directory" then
@@ -45,10 +45,10 @@ if oldparams.value.device and oldparams.value.device.value.mac and oldparams.val
if string.match(d, string.lower(oldparams.value.device.value.mac.value)) and posix.stat(path..d, "type") == "regular" then
local newfile = string.gsub(d, string.lower(oldparams.value.device.value.mac.value), string.lower(params.value.device.value.mac.value))
if deletefiles then
- --APP.logevent("deleting "..path..d)
+ --functions.logevent("deleting "..path..d)
os.remove(path..d)
else
- --APP.logevent("moving "..path..d.." to "..path..newfile)
+ --functions.logevent("moving "..path..d.." to "..path..newfile)
os.rename(path..d, path..newfile)
end
end