Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- client.lua
- local modem = peripheral.wrap("back") -- Assuming the modem is attached to the back
- function connectToDevice()
- print("Enter device ID:")
- local deviceID = read()
- print("Enter OS to send (DOS-STANDARD or DOS-DEV):")
- local selectedOS = read()
- modem.transmit(deviceID, 123, {action = "connect", os = selectedOS})
- print("Request sent to server.")
- end
- function viewRecoveryImages()
- -- Add code to list all directories on the client
- local directories = fs.list("/")
- print("Recovery Images:")
- for _, dir in ipairs(directories) do
- print(dir)
- end
- end
- function loadCustomRecoveryImage()
- print("Enter device ID:")
- local deviceID = read()
- -- Add code to list directories excluding DOS-STANDARD and DOS-DEV
- print("Enter the number of the directory to send:")
- local selectedDir = read()
- modem.transmit(deviceID, 123, {action = "load_custom", dir = selectedDir})
- print("Request sent to server.")
- end
- function powerMenu()
- print("Power Menu:")
- print("1. Shutdown")
- print("2. Reboot")
- local choice = read()
- if choice == "1" then
- os.shutdown()
- elseif choice == "2" then
- os.reboot()
- else
- print("Invalid choice.")
- end
- end
- -- Main menu loop
- while true do
- print("Doggy OS Enterprise Recovery Menu:")
- print("-------------------------------------")
- print("1. Connect to device")
- print("2. View Doggy OS Recovery images")
- print("3. Load Custom Recovery Image")
- print("4. Power Menu")
- local option = read()
- if option == "1" then
- connectToDevice()
- elseif option == "2" then
- viewRecoveryImages()
- elseif option == "3" then
- loadCustomRecoveryImage()
- elseif option == "4" then
- powerMenu()
- else
- print("Invalid option. Please try again.")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement