gluon-hoodselector: use gluon-switch-domain

This commit is contained in:
Matthias Schiffer 2020-06-30 22:49:08 +02:00
parent 6750aef017
commit 6ab9d3415d
2 changed files with 2 additions and 7 deletions

View File

@ -67,9 +67,7 @@ end
function M.set_domain_config(domain)
if uci:get('gluon', 'core', 'domain') ~= domain.domain_code then
uci:set('gluon', 'core', 'domain', domain.domain_code)
uci:commit('gluon')
os.execute('gluon-reconfigure')
os.execute(string.format("exec gluon-switch-domain --no-reboot '%s'", domain.domain_code))
M.log('Set domain "'..domain.domain.domain_names[domain.domain_code]..'"')
return true
end

View File

@ -40,7 +40,6 @@ if geo.lat ~= nil and geo.lon ~= nil then
local geo_base_domain = hoodutil.get_domain_by_geo(jdomains, geo)
if geo_base_domain ~= nil then
if hoodutil.set_domain_config(geo_base_domain) then
os.execute("gluon-reload")
hoodutil.log('Domain set by geolocation mode.\n')
end
return
@ -51,6 +50,4 @@ else
end
-- default domain mode
if hoodutil.set_domain_config(hoodutil.get_default_domain(hoodutil.get_domains())) then
os.execute("gluon-reload")
end
hoodutil.set_domain_config(hoodutil.get_default_domain(hoodutil.get_domains()))