Operating system for OpenComputers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
572B

  1. os.spawn(function() print(pcall(function()
  2. print(_OSVERSION,tostring(math.floor(computer.totalMemory()/1024)).."K memory")
  3. os.setenv("PWD","/boot")
  4. local f = fs.open("/boot/init.txt","rb")
  5. if f then
  6. local fc = f:read("*a")
  7. f:close()
  8. for line in fc:gmatch("[^\n]+") do
  9. print("Starting service "..line)
  10. spawnfile("/boot/service/"..line,line)
  11. end
  12. end
  13. for k,v in pairs(fd) do
  14. if v.t == "t" then
  15. os.setenv("t",k)
  16. print("Spawning a shell for terminal #"..tostring(k))
  17. spawnfile("/boot/exec/shell.lua","shell [local:"..tostring(k).."]")
  18. end
  19. end
  20. end)) end,"init")