diff options
author | Zach LeBar <zach@zachlebar.com> | 1980-02-08 22:06:51 +0000 |
---|---|---|
committer | Zach LeBar <zach@zachlebar.com> | 1980-02-08 22:06:51 +0000 |
commit | 82984dcb0b0495859e67662dc4a4f5a9ca83d1de (patch) | |
tree | 7a98f04c1fbec47fbd9db3ddc34ec3da12b7712b /config/delete_device.lua | |
parent | 454e50286e149cc056787173acec49920e632e1e (diff) | |
parent | c11f4f201fa92e73b0fd5953a49286b69586e239 (diff) | |
download | acf-provisioning-82984dcb0b0495859e67662dc4a4f5a9ca83d1de.tar.bz2 acf-provisioning-82984dcb0b0495859e67662dc4a4f5a9ca83d1de.tar.xz |
Fixing merge conflicts.
Diffstat (limited to 'config/delete_device.lua')
-rw-r--r-- | config/delete_device.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/config/delete_device.lua b/config/delete_device.lua index ea69da2..d7e34a1 100644 --- a/config/delete_device.lua +++ b/config/delete_device.lua @@ -10,10 +10,12 @@ 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 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 - APP.logevent("deleting "..path..d) - os.remove(path..d) + 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 + APP.logevent("deleting "..path..d) + os.remove(path..d) + end end end end |