Skip to content

Commit

Permalink
gluon-geolocator: upgrade script prepare for new site file
Browse files Browse the repository at this point in the history
  • Loading branch information
2tata committed Aug 13, 2017
1 parent 3736fe0 commit 1acc557
Showing 1 changed file with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,19 @@ local static_location = uci:get(config, 'settings', 'static_location')

local auto_location = uci:get(config, 'settings', 'auto_location')
if not auto_location then
auto_location = 0
if site.geolocator.autolocation then
auto_location = tonumber(site.geolocator.autolocation)
end
auto_location = site.geolocator.autolocation(false)
end

local refresh_interval = uci:get(config, 'settings', 'refresh_interval')
if not refresh_interval then
refresh_interval = 43200 --12h
if site.geolocator.interval then
refresh_interval = tonumber(site.geolocator.interval)
end
refresh_interval = site.geolocator.interval(43200) -- default: 12h
end

uci:delete(config, 'settings')
uci:section(config, config, 'settings', {
static_location = static_location,
refresh_interval = refresh_interval,
auto_location = auto_location,
blacklist = site.geolocator.blacklist,
static_location = static_location,
refresh_interval = refresh_interval,
auto_location = auto_location,
blacklist = site.geolocator.blacklist({}),
})
uci:save(config)

0 comments on commit 1acc557

Please sign in to comment.