gluon-geolocator: upgrade script prepare for new site file
This commit is contained in:
parent
75748d14ab
commit
5c624e119b
@ -9,25 +9,19 @@ local static_location = uci:get(config, 'settings', 'static_location')
|
|||||||
|
|
||||||
local auto_location = uci:get(config, 'settings', 'auto_location')
|
local auto_location = uci:get(config, 'settings', 'auto_location')
|
||||||
if not auto_location then
|
if not auto_location then
|
||||||
auto_location = 0
|
auto_location = site.geolocator.autolocation(false)
|
||||||
if site.geolocator.autolocation then
|
|
||||||
auto_location = tonumber(site.geolocator.autolocation)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local refresh_interval = uci:get(config, 'settings', 'refresh_interval')
|
local refresh_interval = uci:get(config, 'settings', 'refresh_interval')
|
||||||
if not refresh_interval then
|
if not refresh_interval then
|
||||||
refresh_interval = 43200 --12h
|
refresh_interval = site.geolocator.interval(43200) -- default: 12h
|
||||||
if site.geolocator.interval then
|
|
||||||
refresh_interval = tonumber(site.geolocator.interval)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
uci:delete(config, 'settings')
|
uci:delete(config, 'settings')
|
||||||
uci:section(config, config, 'settings', {
|
uci:section(config, config, 'settings', {
|
||||||
static_location = static_location,
|
static_location = static_location,
|
||||||
refresh_interval = refresh_interval,
|
refresh_interval = refresh_interval,
|
||||||
auto_location = auto_location,
|
auto_location = auto_location,
|
||||||
blacklist = site.geolocator.blacklist,
|
blacklist = site.geolocator.blacklist({}),
|
||||||
})
|
})
|
||||||
uci:save(config)
|
uci:save(config)
|
||||||
|
Loading…
Reference in New Issue
Block a user