diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 10022d9..73b03b0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,11 @@ Change log ^^^^^^^^^^ +0.4.1 [unreleased] +================== + +WIP + 0.4.0 [2016-06-23] ================== diff --git a/VERSION b/VERSION index 1d0ba9e..39bbca7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.0 +0.4.1a diff --git a/openwisp-config/files/sbin/openwisp-uci-autoname.lua b/openwisp-config/files/sbin/openwisp-uci-autoname.lua index 20c3d30..5889b77 100755 --- a/openwisp-config/files/sbin/openwisp-uci-autoname.lua +++ b/openwisp-config/files/sbin/openwisp-uci-autoname.lua @@ -30,22 +30,25 @@ end for file in lfs.dir(standard_path) do if file ~= '.' and file ~= '..' then local changed = false - for key, section in pairs(standard:get_all(file)) do - if section['.anonymous'] then - output:delete(file, section['.name']) - if file == 'system' and section['.type'] == 'system' then - section['.name'] = 'system' + local config = standard:get_all(file) + if config then + for key, section in pairs(config) do + if section['.anonymous'] then + output:delete(file, section['.name']) + if file == 'system' and section['.type'] == 'system' then + section['.name'] = 'system' + end + section['.anonymous'] = false + write_uci_section(output, file, section) + output:reorder(file, 'system', 0) + changed = true + -- append new named section to stdout var + stdout = stdout .. file .. '.' .. section['.name'] .. ', ' end - section['.anonymous'] = false - write_uci_section(output, file, section) - output:reorder(file, 'system', 0) - changed = true - -- append new named section to stdout var - stdout = stdout .. file .. '.' .. section['.name'] .. ', ' end - end - if changed then - output:commit(file) + if changed then + output:commit(file) + end end end end