forked from izaya/OC-PsychOS2
made init cope if there is no init.txt
This commit is contained in:
parent
d71dec7b8d
commit
1ba6cd3ade
@ -1,15 +1,18 @@
|
|||||||
os.spawn(function() print(pcall(function()
|
os.spawn(function() print(pcall(function()
|
||||||
print(_OSVERSION,tostring(math.floor(computer.totalMemory()/1024)).."K memory")
|
print(_OSVERSION,tostring(math.floor(computer.totalMemory()/1024)).."K memory")
|
||||||
|
os.setenv("PWD","/boot")
|
||||||
local f = fs.open("/boot/init.txt","rb")
|
local f = fs.open("/boot/init.txt","rb")
|
||||||
local fc = f:read("*a")
|
if f then
|
||||||
f:close()
|
local fc = f:read("*a")
|
||||||
for line in fc:gmatch("[^\n]+") do
|
f:close()
|
||||||
|
for line in fc:gmatch("[^\n]+") do
|
||||||
print("Starting service "..line)
|
print("Starting service "..line)
|
||||||
spawnfile("/boot/service/"..line)
|
spawnfile("/boot/service/"..line,line)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
for k,v in pairs(fd) do
|
for k,v in pairs(fd) do
|
||||||
if v.t == "t" then
|
if v.t == "t" then
|
||||||
tTasks[cPid].t = k
|
os.setenv("t",k)
|
||||||
print("Spawning a shell for terminal #"..tostring(k))
|
print("Spawning a shell for terminal #"..tostring(k))
|
||||||
spawnfile("/boot/exec/shell.lua","shell #"..tostring(k))
|
spawnfile("/boot/exec/shell.lua","shell #"..tostring(k))
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user