Skip to content
Snippets Groups Projects
Unverified Commit 05c29512 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-core: sysconfig: avoid unnecessary writes

Do not write files when the content is unchanged.

Avoids a few unnecessary filesystem writes when resetting ifname
sysconfigs on each upgrade.
parent c2a5f57c
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,10 @@ local function get(_, name)
end
local function set(_, name, val)
if val == get(nil, name) then
return
end
if val then
local f = io.open(sysconfigdir .. name, 'w+')
f:write(val, '\n')
......
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