Skip to content
Snippets Groups Projects
Commit 4658afb2 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-core: commit all UCI configs at the end

Avoid commiting configs inbetween to decrease number of flash writes.

Fixes #714.
parent 827d81aa
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 20 deletions
......@@ -131,5 +131,3 @@ util.iterate_radios(configure_radio)
uci:save('wireless')
uci:save('network')
uci:commit('wireless')
uci:commit('network')
......@@ -16,4 +16,3 @@ if not c:get('network', 'mesh_wan') then
end
c:save('network')
c:commit('network')
......@@ -33,5 +33,4 @@ if sysconfig.lan_ifname and not uci:get('network', 'mesh_lan') then
})
uci:save('network')
uci:commit('network')
end
......@@ -6,5 +6,4 @@ if uci:get('system', 'rssid_wlan0') then
uci:set('system', 'rssid_wlan0', 'dev', 'mesh0')
uci:save('system')
uci:commit('system')
end
......@@ -119,7 +119,6 @@ add_groups('mesh_vpn', site.fastd_mesh_vpn.groups)
uci:save('fastd')
uci:commit('fastd')
uci:section('network', 'interface', 'mesh_vpn',
......@@ -133,7 +132,6 @@ uci:section('network', 'interface', 'mesh_vpn',
)
uci:save('network')
uci:commit('network')
uci:section('firewall', 'include', 'mesh_vpn_dns',
......@@ -145,4 +143,3 @@ uci:section('firewall', 'include', 'mesh_vpn_dns',
)
uci:save('firewall')
uci:commit('firewall')
......@@ -9,5 +9,4 @@ local secret = c:get("fastd", "mesh_vpn", "secret")
if not secret or not secret:match(("%x"):rep(64)) then
c:set("fastd", "mesh_vpn", "secret", "generate")
c:save("fastd")
c:commit("fastd")
end
......@@ -28,5 +28,4 @@ if not uci:get('simple-tc', 'mesh_vpn') then
uci:section('simple-tc', 'interface', 'mesh_vpn', config)
uci:save('simple-tc')
uci:commit('simple-tc')
end
......@@ -17,4 +17,3 @@ uci:section('firewall', 'rule', 'wan_respondd_reply',
)
uci:save('firewall')
uci:commit('firewall')
......@@ -39,7 +39,6 @@ c:section('network', 'route6', 'local_node_route6',
)
c:save('network')
c:commit('network')
c:delete('firewall', 'local_node')
c:section('firewall', 'zone', 'local_node',
......@@ -52,4 +51,3 @@ c:section('firewall', 'zone', 'local_node',
}
)
c:save('firewall')
c:commit('firewall')
......@@ -7,5 +7,4 @@ local config = 'gluon-node-info'
if not uci:get_first(config, 'system') then
uci:section(config, 'system')
uci:save(config)
uci:commit(config)
end
......@@ -15,5 +15,4 @@ end
if not role then
uci:set(config, uci:get_first(config, 'system'), 'role', default_role)
uci:save(config)
uci:commit(config)
end
......@@ -29,4 +29,3 @@ uci:section('firewall', 'rule', 'client_respondd',
)
uci:save('firewall')
uci:commit('firewall')
......@@ -11,6 +11,5 @@ if site.setup_mode
local name = c:get_first("gluon-setup-mode", "setup_mode")
c:set("gluon-setup-mode", name, "configured", 1)
c:save('gluon-setup-mode')
c:commit('gluon-setup-mode')
end
......@@ -12,7 +12,6 @@ if old == '1' then
c:set('gluon-setup-mode', setup_mode, 'configured', '1')
c:save('gluon-setup-mode')
c:commit('gluon-setup-mode')
end
os.remove('/etc/config/gluon-config-mode')
......@@ -10,6 +10,4 @@ uci batch <<-EOF
set uhttpd.main.home=/lib/gluon/status-page/www
set uhttpd.main.max_requests=32
commit uhttpd
EOF
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment