1
0
mirror of https://github.com/Adorable-Catgirl/Zorya-NEO.git synced 2024-11-27 12:48:07 +11:00
Zorya-NEO/util/OpenOS/zyneo-gencfg.lua

19 lines
488 B
Lua
Raw Normal View History

2020-03-20 07:50:37 +11:00
local fs = require("filesystem")
print("Regenerating Zorya NEO configuration...")
fs.copy("/.zy2/cfg.lua", "/.zy2/cfg.lua.old")
local f = io.open("/.zy2/cfg.lua", "wb")
local lst = {}
for ent in fs.list("/etc/zorya-neo/config.d") do
if ent:sub(#ent) ~= "/" then
lst[#lst+1] = ent
end
end
table.sort(lst)
for i=1, #lst do
print("> "..lst[i])
assert(loadfile("/etc/zorya-neo/config.d/"..lst[i]))(function(code)
f:write(code)
end)
end
f:close()
print("Generated new configuration.")