Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not fs.exists("/disk") or not fs.isDir("/disk") then
- print("Waiting for disk...")
- end
- while not fs.exists("/disk") or not fs.isDir("/disk") do
- sleep(1)
- end
- print("Installing the boot disk program will delete all the files on the disk.")
- write("Continue? [Y/n]: ")
- local resp = read()
- if resp:lower():find("n") then
- print("Install cancelled.")
- return
- end
- for _, v in pairs(fs.list("/disk")) do
- pcall(fs.delete, "/disk/" .. v)
- end
- local content = http.get("http://pastebin.com/raw.php?i=BvvkvEp4")
- if not content then
- printError("Failed to download boot program from pastebin! Please try again later.")
- return
- end
- local f = io.open("/disk/startup", "w")
- f:write(content.readAll())
- f:close()
- local side = nil
- for _, v in pairs(peripheral.getNames()) do
- if peripheral.getType(v) == "drive" and
- peripheral.call(v, "hasData") then
- if peripheral.call(v, "getMountPath") == "disk" then
- side = v
- break
- end
- end
- end
- if side then
- peripheral.call(side, "setDiskLabel", "Rescue Boot Disk")
- end
- if term.isColor() then
- term.setTextColor(colors.yellow)
- end
- print("")
- print("Installation successful!")
- print("Follow these steps to disinfect a computer:")
- print("1. Disconnect the computer from any modem networks.")
- print("2. Make sure there are no other computers which can access the disk drive.")
- print("3. Hold Ctrl + S on the infected computer to shut it down.")
- print("4. While the computer is turned off, insert the boot disk.")
- print("5. Turn on the computer, and follow on-screen prompts (if any).")
- print("")
- print("Thanks for using 1lann's rescue boot disk!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement