Commit bfcf8170 authored by Julian Schuh's avatar Julian Schuh
Browse files

cleanup

parent 08df82b3
......@@ -11,27 +11,19 @@ function Set (list)
end
local from_branches = Set(site.update_stabilizer.from_branches())
if not from_branches[uci:get('autoupdater', 'settings', 'branch')] then
local current_branch = uci:get('autoupdater', 'settings', 'branch')
if not from_branches[current_branch] then
return
end
local update_branch = false
-- These routers were introduced since the last major
-- release, so if you wanted to use them you had to
-- use an experimental image.
local new_models = Set(site.update_stabilizer.models())
if new_models[platform_info.get_image_name()] then
update_branch = true
print('[+] device was introduced after latest stable release')
if not new_models[platform_info.get_image_name()] then
return
end
print('[+] device matches criteria for change of autoupdater branch')
if update_branch then
local to_branch = site.update_stabilizer.to_branch()
uci:set('autoupdater', 'settings', 'branch', to_branch)
uci:save('autoupdater')
print('[+] autoupdater branch set to ' .. to_branch)
end
local to_branch = site.update_stabilizer.to_branch()
uci:set('autoupdater', 'settings', 'branch', to_branch)
uci:save('autoupdater')
print('[+] autoupdater branch set to ' .. to_branch)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment