Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local term = term
- local function centerText(y, text)
- local w, _ = term.getSize()
- local x = math.floor((w - #text) / 2) + 1
- term.setCursorPos(x, y)
- term.write(text)
- end
- local function drawUI()
- term.clear()
- term.setCursorPos(1,1)
- centerText(3, "\x1b[31m[ SYSTEM RECOVERY MODE ]\x1b[0m")
- centerText(5, "Initializing Boot Sector Restoration...")
- centerText(7, "Ensure the SSD/HDD remains connected.")
- end
- drawUI()
- sleep(5)
- term.clear()
- centerText(5, "\x1b[33mWARNING:\x1b[0m Bootloader restoration will overwrite existing data.")
- centerText(7, "Press ENTER to proceed or CTRL+T to abort.")
- read()
- term.clear()
- centerText(3, "[ PROCESSING ]")
- centerText(5, "Erasing previous boot configuration...")
- sleep(2)
- shell.run("delete", "/no-os")
- shell.run("delete", "/startup")
- term.clear()
- centerText(3, "[ INSTALLATION IN PROGRESS ]")
- for i = 1, 20 do
- term.setCursorPos(10 + i, 7)
- term.write("#")
- sleep(0.1)
- end
- centerText(9, "Deploying new bootloader components...")
- sleep(1)
- shell.run("cp", "/disk/boot/error/", "/startup")
- shell.run("cp", "/disk/bootloader/no-os.lua", "/no-os")
- term.clear()
- centerText(3, "[ COMPLETION STATUS ]")
- centerText(5, "\x1b[32mBootloader successfully restored!\x1b[0m")
- sleep(3)
- term.clear()
- centerText(3, "[ DEBUG INFO ]")
- centerText(5, "Boot files verified. No errors detected.")
- centerText(7, "System will now reboot.")
- sleep(2)
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement