Skip to content
Snippets Groups Projects
Commit 27501087 authored by Jan-Tarek Butt's avatar Jan-Tarek Butt
Browse files

add new upgrade script for static location

parent bf8e2d1c
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/lua
local site = require 'gluon.site_config'
local uci = require('luci.model.uci').cursor()
local config = 'gluon-node-info'
local longitude = uci:get(config, uci:get_first(config, 'location'), 'longitude')
local latitude = uci:get(config, uci:get_first(config, 'location'), 'latitude')
local staticlocation = uci:get(config, uci:get_first(config, 'location'), 'static_location')
if tonumber(longitude) ~= nil and tonumber(latitude) ~= nil then
default_static_location = 1
else
default_static_location = 0
end
if not staticlocation then
uci:set(config, uci:get_first(config, 'location'), 'static_location', default_static_location)
uci:save(config)
uci:commit(config)
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment