diff options
author | Ted Trask <ttrask01@yahoo.com> | 2013-08-26 19:00:27 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2013-08-26 19:01:02 +0000 |
commit | 837476e5a4c3d872ec0734537a56b3e95a31000e (patch) | |
tree | 0c7a37b5c8ed7264062b3409022bcfa671f24ba6 /config/delete_device.lua | |
parent | 050d1a96a13db9188c5d550d10907fcc6f96a1a8 (diff) | |
download | acf-provisioning-837476e5a4c3d872ec0734537a56b3e95a31000e.tar.bz2 acf-provisioning-837476e5a4c3d872ec0734537a56b3e95a31000e.tar.xz |
Update scripts to limit which Polycom files are moved / deleted
Diffstat (limited to 'config/delete_device.lua')
-rw-r--r-- | config/delete_device.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/config/delete_device.lua b/config/delete_device.lua index 542ed8b..4f5fee7 100644 --- a/config/delete_device.lua +++ b/config/delete_device.lua @@ -7,8 +7,9 @@ local root = "/var/www/provisioning/htdocs/" --APP.logevent("got to delete_device script") --- First, we delete the associated config files -if oldparams.value.device and string.match(oldparams.value.device.label, "Polycom") and oldparams.value.device.value.mac then +-- First, we delete the associated config files for Polycom with valid MAC (not blank or all 0's) +if oldparams.value.device and string.match(oldparams.value.device.label, "Polycom") and oldparams.value.device.value.mac and string.match(oldparams.value.device.value.mac.value, "[1-9A-F]") then + --APP.logevent("Deleting files for "..oldparams.value.device.value.mac.value) local path = root.."Polycom/" if posix.stat(path, "type") == "directory" then for d in posix.files(path) do |