Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- term.clear()
- term.setCursorPos(1,1)
- deletedone = false
- local dirs = {"/boot", "/etc", "/home", "/lib", "/tmp", "/usr", "/var", "/bin"}
- local function deleteDirs()
- for idx, val in ipairs(dirs) do
- if fs.exists(val) then
- shell.run("rm", val)
- textutils.slowPrint("###########")
- deletedone = true
- end
- end
- end
- print("Deleting pre-exists files...")
- if fs.exists("/startup") then
- shell.run("rm", "/startup")
- term.setTextColor(colors.red)
- textutils.slowPrint("###########")
- deletedone = true
- end
- deleteDirs()
- if deletedone == true then
- term.setTextColor(colors.green)
- print("Deleted!")
- else
- term.setTextColor(colors.red)
- print("No files to delete")
- end
- sleep(1)
- term.setTextColor(colors.white)
- print("Copying fils...")
- shell.run("cp", "/disk/bios/startup.bios", "/startup")
- term.setTextColor(colors.red)
- textutils.slowPrint("###########")
- shell.run("cp", "/disk/diamondOS/os/*", "/")
- textutils.slowPrint("###########")
- shell.run("cp", "/disk/diamondOS/back.lua", "/back")
- textutils.slowPrint("###########")
- term.setTextColor(colors.green)
- print("Copyed!")
- term.setTextColor(colors.white)
- sleep(1)
- ----------------------------------
- settings.set("bootFile", "/boot/craftbootloader.lua")
- settings.save()
- print("Deleting temp files")
- sleep(1)
- shell.run("/.deletetemp")
- term.setTextColor(colors.red)
- textutils.slowPrint("###########")
- term.setTextColor(colors.green)
- print("Done.")
- term.setTextColor(colors.white)
- sleep(1)
- disk.eject("top")
- disk.eject("bottom")
- disk.eject("left")
- disk.eject("right")
- disk.eject("front")
- disk.eject("back")
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment