Advertisement
DOGGYWOOF

Untitled

Feb 6th, 2025
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. local term = term
  2.  
  3. local function centerText(y, text)
  4. local w, _ = term.getSize()
  5. local x = math.floor((w - #text) / 2) + 1
  6. term.setCursorPos(x, y)
  7. term.write(text)
  8. end
  9.  
  10. local function drawUI()
  11. term.clear()
  12. term.setCursorPos(1,1)
  13. centerText(3, "\x1b[31m[ SYSTEM RECOVERY MODE ]\x1b[0m")
  14. centerText(5, "Initializing Boot Sector Restoration...")
  15. centerText(7, "Ensure the SSD/HDD remains connected.")
  16. end
  17.  
  18. drawUI()
  19. sleep(5)
  20.  
  21. term.clear()
  22. centerText(5, "\x1b[33mWARNING:\x1b[0m Bootloader restoration will overwrite existing data.")
  23. centerText(7, "Press ENTER to proceed or CTRL+T to abort.")
  24. read()
  25.  
  26. term.clear()
  27. centerText(3, "[ PROCESSING ]")
  28. centerText(5, "Erasing previous boot configuration...")
  29. sleep(2)
  30. shell.run("delete", "/no-os")
  31. shell.run("delete", "/startup")
  32.  
  33. term.clear()
  34. centerText(3, "[ INSTALLATION IN PROGRESS ]")
  35. for i = 1, 20 do
  36. term.setCursorPos(10 + i, 7)
  37. term.write("#")
  38. sleep(0.1)
  39. end
  40.  
  41. centerText(9, "Deploying new bootloader components...")
  42. sleep(1)
  43. shell.run("cp", "/disk/boot/error/", "/startup")
  44. shell.run("cp", "/disk/bootloader/no-os.lua", "/no-os")
  45.  
  46. term.clear()
  47. centerText(3, "[ COMPLETION STATUS ]")
  48. centerText(5, "\x1b[32mBootloader successfully restored!\x1b[0m")
  49. sleep(3)
  50.  
  51. term.clear()
  52. centerText(3, "[ DEBUG INFO ]")
  53. centerText(5, "Boot files verified. No errors detected.")
  54. centerText(7, "System will now reboot.")
  55. sleep(2)
  56. os.reboot()
  57.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement