OC-PsychOS2/module/init.lua

21 lines
561 B
Lua
Raw Normal View History

2018-11-03 03:05:41 +11:00
os.spawn(function() print(pcall(function()
print(_OSVERSION,tostring(math.floor(computer.totalMemory()/1024)).."K memory")
2019-01-08 17:59:01 +11:00
os.setenv("PWD","/boot")
2018-11-03 03:05:41 +11:00
local f = fs.open("/boot/init.txt","rb")
2019-01-08 17:59:01 +11:00
if f then
local fc = f:read("*a")
f:close()
for line in fc:gmatch("[^\n]+") do
print("Starting service "..line)
spawnfile("/boot/service/"..line,line)
end
2018-11-03 03:05:41 +11:00
end
for k,v in pairs(fd) do
if v.t == "t" then
2019-01-08 17:59:01 +11:00
os.setenv("t",k)
2018-11-03 03:05:41 +11:00
print("Spawning a shell for terminal #"..tostring(k))
spawnfile("/boot/exec/shell.lua","shell #"..tostring(k))
end
end
end)) end,"init")