Update sPhone.lua
This commit is contained in:
parent
974dcb72f8
commit
55db5b3c12
1 changed files with 33 additions and 26 deletions
|
@ -50,6 +50,7 @@ local function recovery()
|
|||
print("[2] Update sPhone")
|
||||
print("[3] Reset User Config")
|
||||
print("[4] Continue Booting")
|
||||
print("[5] Boot in safe mode")
|
||||
while true do
|
||||
local _, k = os.pullEvent("key")
|
||||
if k == 2 then
|
||||
|
@ -79,6 +80,10 @@ local function recovery()
|
|||
os.reboot()
|
||||
elseif k == 5 then
|
||||
break
|
||||
elseif k == 6 then
|
||||
recoverym = {}
|
||||
recoverym.safemode = true
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -133,6 +138,16 @@ local function kernel()
|
|||
f.close()
|
||||
end
|
||||
|
||||
if not fs.exists("/.sPhone/apis") then
|
||||
fs.makeDir("/.sPhone/apis")
|
||||
end
|
||||
|
||||
for k, v in pairs(fs.list("/.sPhone/apis")) do
|
||||
if not fs.isDir("/.sPhone/apis/"..v) then
|
||||
os.loadAPI("/.sPhone/apis/"..v)
|
||||
end
|
||||
end
|
||||
|
||||
if not fs.exists("/.sPhone/autorun") then
|
||||
fs.makeDir("/.sPhone/autorun")
|
||||
end
|
||||
|
@ -140,10 +155,10 @@ local function kernel()
|
|||
term.setBackgroundColor(colors.white)
|
||||
term.clear()
|
||||
term.setCursorPos(1,1)
|
||||
|
||||
for k, v in pairs(fs.list("/.sPhone/autorun")) do
|
||||
term.setTextColor(colors.black)
|
||||
if not fs.isDir("/.sPhone/autorun/"..v) then
|
||||
if not recoverym.safemode then
|
||||
local f = fs.open("/.sPhone/autorun/"..v,"r")
|
||||
local script = f.readAll()
|
||||
f.close()
|
||||
|
@ -158,8 +173,10 @@ local function kernel()
|
|||
print(v.." disabled to prevent errors")
|
||||
sleep(0.5)
|
||||
end
|
||||
|
||||
|
||||
else
|
||||
print("Script "..v.." not loaded because Safe Mode")
|
||||
sleep(0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -173,16 +190,6 @@ local function kernel()
|
|||
u.close()
|
||||
end
|
||||
|
||||
if not fs.exists("/.sPhone/apis") then
|
||||
fs.makeDir("/.sPhone/apis")
|
||||
end
|
||||
|
||||
for k, v in pairs(fs.list("/.sPhone/apis")) do
|
||||
if not fs.isDir("/.sPhone/apis/"..v) then
|
||||
os.loadAPI("/.sPhone/apis/"..v)
|
||||
end
|
||||
end
|
||||
|
||||
if not fs.exists("/.sPhone/config/sPhone") then
|
||||
config.write("/.sPhone/config/sPhone","devMode",false)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue