Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Function to prompt user to remove disk and continue
- local function waitForDiskRemoval()
- print("Please remove the disk and press Enter to continue.")
- io.read() -- Wait for user to press Enter
- end
- -- Prompt the user to insert the first disk
- print("Please insert the first disk and press Enter.")
- io.read()
- -- Check if the disk is inserted
- if not fs.exists("/disk") or not fs.isDir("/disk") then
- print("Error: Disk not found or not mounted properly.")
- return
- end
- -- Copy the contents of the disk to /temp/
- if not fs.exists("/temp") then
- fs.makeDir("/temp")
- end
- for _, file in ipairs(fs.list("/disk")) do
- fs.copy("/disk/" .. file, "/temp/" .. file)
- end
- -- Prompt the user to remove the first disk
- print("Please remove the first disk.")
- waitForDiskRemoval() -- Wait for user to remove the disk
- -- Prompt the user to insert the second disk
- print("Please insert the second disk and press Enter.")
- io.read()
- -- Check if the disk is inserted
- if not fs.exists("/disk2") or not fs.isDir("/disk2") then
- print("Error: Second disk not found or not mounted properly.")
- return
- end
- -- Copy the contents of /temp/ to /disk2/
- for _, file in ipairs(fs.list("/temp")) do
- fs.copy("/temp/" .. file, "/disk2/" .. file)
- end
- -- Delete /temp/ folder
- fs.delete("/temp")
- -- Create the startup file on /disk2/
- local startupContent = [[
- shell.run("/disk/boot/error")
- shell.run("/disk/boot/startup")
- shell.run("/disk/boot/startup.lua")
- ]]
- local startupFile = fs.open("/disk2/startup", "w")
- startupFile.write(startupContent)
- startupFile.close()
- -- Notify the user and prompt for reboot
- print("Setup completed. Please reboot the computer.")
- -- Reboot the computer
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement