summaryrefslogtreecommitdiffstats
path: root/config/update_device_params.lua
diff options
context:
space:
mode:
authorZach LeBar <zach@zachlebar.com>1980-02-08 22:06:51 +0000
committerZach LeBar <zach@zachlebar.com>1980-02-08 22:06:51 +0000
commit82984dcb0b0495859e67662dc4a4f5a9ca83d1de (patch)
tree7a98f04c1fbec47fbd9db3ddc34ec3da12b7712b /config/update_device_params.lua
parent454e50286e149cc056787173acec49920e632e1e (diff)
parentc11f4f201fa92e73b0fd5953a49286b69586e239 (diff)
downloadacf-provisioning-82984dcb0b0495859e67662dc4a4f5a9ca83d1de.tar.bz2
acf-provisioning-82984dcb0b0495859e67662dc4a4f5a9ca83d1de.tar.xz
Fixing merge conflicts.
Diffstat (limited to 'config/update_device_params.lua')
-rw-r--r--config/update_device_params.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/config/update_device_params.lua b/config/update_device_params.lua
index 5d13099..61d33d2 100644
--- a/config/update_device_params.lua
+++ b/config/update_device_params.lua
@@ -33,11 +33,13 @@ oldparams = oldparams or {value={}}
if oldparams.value.device and oldparams.value.device.value.mac and oldparams.value.device.value.mac.value ~= "" and params.value.device and params.value.device.value.mac and params.value.device.value.mac.value ~= oldparams.value.device.value.mac.value then
if string.match(oldparams.value.device.label, "Polycom") then
local path = root.."Polycom/"
- for d in posix.files(path) do
- 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))
- APP.logevent("moving "..path..d.." to "..path..newfile)
- os.rename(path..d, path..newfile)
+ if posix.stat(path, "type") == "directory" then
+ for d in posix.files(path) do
+ 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))
+ APP.logevent("moving "..path..d.." to "..path..newfile)
+ os.rename(path..d, path..newfile)
+ end
end
end
end