Advertisement
DOGGYWOOF

test

Apr 1st, 2024
9
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.51 KB | None | 0 0
  1. -- Function to display the menu
  2. local function displayMenu()
  3. term.clear()
  4. term.setCursorPos(1,1)
  5. print("Doggy OS Debug Menu")
  6. print("-----------------------")
  7. print("1. Force Recovery Mode")
  8. print("2. Force User management")
  9. print("3. View Root Directory")
  10. print("4. Edit Root password")
  11. print("5. Install Firmware")
  12. print("6. Force System Uninstall")
  13. print("----------------------------")
  14. end
  15.  
  16. -- Function to perform actions based on user input
  17. local function performAction(option)
  18. if option == "1" then
  19. if fs.exists("/disk/bootloader/VA11-ILLA.lua") then
  20. print("Booting into recovery")
  21. sleep(2)
  22. shell.run("/disk2/Recovery.lua")
  23. else
  24. term.clear()
  25. term.setCursorPos(1,1)
  26. print("Doggy OS is missing or damaged")
  27. sleep(1)
  28. os.shutdown()
  29. end
  30. elseif option == "2" then
  31. if fs.exists("/disk/bootloader/VA11-ILLA.lua") then
  32. print("Loading User management")
  33. sleep(2)
  34. shell.run("/disk2/users")
  35. else
  36. term.clear()
  37. term.setCursorPos(1,1)
  38. print("Doggy OS is missing or damaged")
  39. sleep(1)
  40. os.shutdown()
  41. end
  42. elseif option == "6" then
  43. sleep(2)
  44. term.clear()
  45. term.setCursorPos(1,1)
  46. print("Clearing Doggy OS files")
  47. sleep(5)
  48. fs.delete("/recovery")
  49. fs.delete("/disk")
  50. fs.delete("startup")
  51. fs.delete("no-os")
  52. fs.copy("/disk2/bootstrap.lua","startup")
  53. os.reboot()
  54. print("Doggy OS has been fully Uninstalled")
  55. elseif option == "3" then
  56. if fs.exists("/disk/") then
  57. shell.run("dir","/disk")
  58. read()
  59. os.reboot()
  60. else
  61. term.clear()
  62. term.setCursorPos(1,1)
  63. print("Doggy OS is damaged or missing")
  64. sleep(1)
  65. os.shutdown()
  66. end
  67. elseif option == "4" then
  68. if fs.exists("/disk/users/root/") then
  69. term.clear()
  70. term.setCursorPos(1,1)
  71. print("Setting Root Password to (Password)")
  72. fs.delete("/disk/users/root/password.txt")
  73. fs.copy("/disk2/pass","/disk/users/root/password.txt")
  74. sleep(2)
  75. print("Password Reset")
  76. sleep(1)
  77. os.reboot()
  78. else
  79. term.clear()
  80. term.setCursorPos(1,1)
  81. print("Doggy OS is damaged or missing")
  82. sleep(1)
  83. os.shutdown()
  84. end
  85. elseif option == "eject" then
  86. print("Exiting program")
  87. sleep(2)
  88. disk.eject("top")
  89. disk.eject("bottom")
  90. disk.eject("left")
  91. disk.eject("right")
  92. os.reboot()
  93. elseif option == "5" then
  94. if fs.exists("/disk/bootloader/VA11-ILLA.lua") then
  95. shell.run("/disk2/installer")
  96. else
  97. term.clear()
  98. term.setCursorPos(1,1)
  99. print("Doggy OS is missing or damaged")
  100. sleep(1)
  101. os.reboot()
  102. end
  103. else
  104. print("Invalid option. Please select 1, 2, or 3.")
  105. os.reboot()
  106. end
  107. end
  108.  
  109. -- Main function to run the program
  110. local function main()
  111. displayMenu() -- Display the menu
  112.  
  113. local option = read() -- Read user input
  114.  
  115. performAction(option) -- Perform action based on user input
  116. end
  117.  
  118. -- Run the program
  119. main()
  120.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement