Commit 2ee0bd72 authored by chrissi^'s avatar chrissi^

nodeconfig: wait after all network changes

Signed-off-by: chrissi^'s avatarChrissi^ <chris@tinyhost.de>
parent 53adfeaa
...@@ -116,6 +116,8 @@ function apply_network(conf, target_state) ...@@ -116,6 +116,8 @@ function apply_network(conf, target_state)
end end
local changes = x:changes() local changes = x:changes()
local changed = false
if not empty(changes) then if not empty(changes) then
dump(changes) dump(changes)
x:commit('dhcp') x:commit('dhcp')
...@@ -124,8 +126,9 @@ function apply_network(conf, target_state) ...@@ -124,8 +126,9 @@ function apply_network(conf, target_state)
print("Reconfiguring network...") print("Reconfiguring network...")
os.execute("/etc/init.d/network restart") os.execute("/etc/init.d/network restart")
os.execute("/etc/init.d/dnsmasq restart") os.execute("/etc/init.d/dnsmasq restart")
util.sleep(20) changed = true
end end
local range6 = util.read_file('/tmp/range6') local range6 = util.read_file('/tmp/range6')
if range6 ~= conf.range6 then if range6 ~= conf.range6 then
if conf.range6 ~= nil and target_state then if conf.range6 ~= nil and target_state then
...@@ -134,7 +137,13 @@ function apply_network(conf, target_state) ...@@ -134,7 +137,13 @@ function apply_network(conf, target_state)
f:close() f:close()
end end
os.execute("/etc/init.d/gluon-radvd restart") os.execute("/etc/init.d/gluon-radvd restart")
changed = true
end end
if changed then
util.sleep(20)
end
return true return true
end end
......
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