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) function M.set_domain_config(domain)
if uci:get('gluon', 'core', 'domain') ~= domain.domain_code then if uci:get('gluon', 'core', 'domain') ~= domain.domain_code then
uci:set('gluon', 'core', 'domain', domain.domain_code) os.execute(string.format("exec gluon-switch-domain --no-reboot '%s'", domain.domain_code))
uci:commit('gluon')
os.execute('gluon-reconfigure')
M.log('Set domain "'..domain.domain.domain_names[domain.domain_code]..'"') M.log('Set domain "'..domain.domain.domain_names[domain.domain_code]..'"')
return true return true
end 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) local geo_base_domain = hoodutil.get_domain_by_geo(jdomains, geo)
if geo_base_domain ~= nil then if geo_base_domain ~= nil then
if hoodutil.set_domain_config(geo_base_domain) then if hoodutil.set_domain_config(geo_base_domain) then
os.execute("gluon-reload")
hoodutil.log('Domain set by geolocation mode.\n') hoodutil.log('Domain set by geolocation mode.\n')
end end
return return
@ -51,6 +50,4 @@ else
end end
-- default domain mode -- default domain mode
if hoodutil.set_domain_config(hoodutil.get_default_domain(hoodutil.get_domains())) then hoodutil.set_domain_config(hoodutil.get_default_domain(hoodutil.get_domains()))
os.execute("gluon-reload")
end