Operating system for OpenComputers
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

21 行
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")