From 669e87751368e9a45efd2a8ca9f86a149fb6d9d8 Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Mon, 15 May 2017 17:18:15 +1000 Subject: [PATCH] Maybe actually added it? --- modules/util/sinit.lua | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/modules/util/sinit.lua b/modules/util/sinit.lua index a093ab0..0e7a3f9 100644 --- a/modules/util/sinit.lua +++ b/modules/util/sinit.lua @@ -1,17 +1,20 @@ -do - if _OSVERSION and _BD then - print("Starting ".._OSVERSION.." built at ".._BD) - end +s("init",function() local f=fopen("boot:/init.cfg","rb") + write("") if f then - local c="" - local nc=fread(f,2048) - while nc ~= nil and nc ~= "" do - c=c..nc - nc=fread(f,2048) + local c="" + local nc=fread(f,2048) + while nc ~= nil and nc ~= "" do + c=c..nc + nc=fread(f,2048) + end + for l in c:gmatch("[^\n]+") do + write("[init] "..l..": ") + local pf=fload(l) + print(pcall(pf)) + end end - for l in c:gmatch("[^\n]+") do - print("[init] "..l) + if _OSVERSION and _BD then + print("Started ".._OSVERSION.." (built at ".._BD..")") end - end -end +end)