added loadlin.lua - for loading PsychOS from OpenOS

This commit is contained in:
Izaya 2017-08-04 14:14:07 +10:00
parent 0f6d126eaf
commit 57e9a106c2
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,4 @@
modules/base/loadlin.lua
modules/debug/log.lua modules/debug/log.lua
modules/base/header.lua modules/base/header.lua
modules/base/component.lua modules/base/component.lua

9
modules/base/loadlin.lua Normal file
View File

@ -0,0 +1,9 @@
if pcall(require,"computer") then
print("OpenOS detected.")
print(os.getenv("_"))
local computer = require "computer"
local process = require "process"
os.execute("cp "..os.getenv("_").." /tmp/init.lua")
computer.setBootAddress(computer.tmpAddress())
computer.shutdown(true)
end