Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Function to display the menu
- local function displayMenu()
- term.clear()
- term.setCursorPos(1,1)
- print("Doggy OS Debug Menu")
- print("-----------------------")
- print("1. Force Recovery Mode")
- print("2. Force User management")
- print("3. View Root Directory")
- print("4. Edit Root password")
- print("5. Install Firmware")
- print("6. Force System Uninstall")
- print("----------------------------")
- end
- -- Function to perform actions based on user input
- local function performAction(option)
- if option == "1" then
- if fs.exists("/disk/bootloader/VA11-ILLA.lua") then
- print("Booting into recovery")
- sleep(2)
- shell.run("/disk2/Recovery.lua")
- else
- term.clear()
- term.setCursorPos(1,1)
- print("Doggy OS is missing or damaged")
- sleep(1)
- os.shutdown()
- end
- elseif option == "2" then
- if fs.exists("/disk/bootloader/VA11-ILLA.lua") then
- print("Loading User management")
- sleep(2)
- shell.run("/disk2/users")
- else
- term.clear()
- term.setCursorPos(1,1)
- print("Doggy OS is missing or damaged")
- sleep(1)
- os.shutdown()
- end
- elseif option == "6" then
- sleep(2)
- term.clear()
- term.setCursorPos(1,1)
- print("Clearing Doggy OS files")
- sleep(5)
- fs.delete("/recovery")
- fs.delete("/disk")
- fs.delete("startup")
- fs.delete("no-os")
- fs.copy("/disk2/bootstrap.lua","startup")
- os.reboot()
- print("Doggy OS has been fully Uninstalled")
- elseif option == "3" then
- if fs.exists("/disk/") then
- shell.run("dir","/disk")
- read()
- os.reboot()
- else
- term.clear()
- term.setCursorPos(1,1)
- print("Doggy OS is damaged or missing")
- sleep(1)
- os.shutdown()
- end
- elseif option == "4" then
- if fs.exists("/disk/users/root/") then
- term.clear()
- term.setCursorPos(1,1)
- print("Setting Root Password to (Password)")
- fs.delete("/disk/users/root/password.txt")
- fs.copy("/disk2/pass","/disk/users/root/password.txt")
- sleep(2)
- print("Password Reset")
- sleep(1)
- os.reboot()
- else
- term.clear()
- term.setCursorPos(1,1)
- print("Doggy OS is damaged or missing")
- sleep(1)
- os.shutdown()
- end
- elseif option == "eject" then
- print("Exiting program")
- sleep(2)
- disk.eject("top")
- disk.eject("bottom")
- disk.eject("left")
- disk.eject("right")
- os.reboot()
- elseif option == "5" then
- if fs.exists("/disk/bootloader/VA11-ILLA.lua") then
- shell.run("/disk2/installer")
- else
- term.clear()
- term.setCursorPos(1,1)
- print("Doggy OS is missing or damaged")
- sleep(1)
- os.reboot()
- end
- else
- print("Invalid option. Please select 1, 2, or 3.")
- os.reboot()
- end
- end
- -- Main function to run the program
- local function main()
- displayMenu() -- Display the menu
- local option = read() -- Read user input
- performAction(option) -- Perform action based on user input
- end
- -- Run the program
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement