gluon-node-info: add a script to fix whitespaces within the coordinates
Signed-off-by: kb-light <freifunk@kb-light.de>
This commit is contained in:
parent
10638960c9
commit
f68a5662b6
14
package/gluon-node-info/files/lib/gluon/upgrade/520-node-info-whitespace-fix
Executable file
14
package/gluon-node-info/files/lib/gluon/upgrade/520-node-info-whitespace-fix
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/lua
|
||||
local uci = require('luci.model.uci').cursor()
|
||||
|
||||
local sname = uci:get_first('gluon-node-info', 'location')
|
||||
if sname then
|
||||
local options = {'longitude', 'latitude', 'altitude'}
|
||||
for _, option in ipairs(options) do
|
||||
local value = uci:get('gluon-node-info', sname, option)
|
||||
if value then
|
||||
uci:set('gluon-node-info', sname, option, value:trim())
|
||||
end
|
||||
end
|
||||
uci:save('gluon-node-info')
|
||||
end
|
Loading…
Reference in New Issue
Block a user