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:
kb-light 2016-04-28 09:34:33 +02:00 committed by Matthias Schiffer
parent 10638960c9
commit f68a5662b6

View 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