Advertisement
1lann

antivirus installer

Aug 1st, 2015
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.61 KB | None | 0 0
  1. if not fs.exists("/disk") or not fs.isDir("/disk") then
  2.     print("Waiting for disk...")
  3. end
  4.  
  5. while not fs.exists("/disk") or not fs.isDir("/disk") do
  6.     sleep(1)
  7. end
  8.  
  9. print("Installing the boot disk program will delete all the files on the disk.")
  10. write("Continue? [Y/n]: ")
  11.  
  12. local resp = read()
  13. if resp:lower():find("n") then
  14.     print("Install cancelled.")
  15.     return
  16. end
  17.  
  18. for _, v in pairs(fs.list("/disk")) do
  19.     pcall(fs.delete, "/disk/" .. v)
  20. end
  21.  
  22. local content = http.get("http://pastebin.com/raw.php?i=BvvkvEp4")
  23. if not content then
  24.     printError("Failed to download boot program from pastebin! Please try again later.")
  25.     return
  26. end
  27.  
  28. local f = io.open("/disk/startup", "w")
  29. f:write(content.readAll())
  30. f:close()
  31.  
  32. local side = nil
  33. for _, v in pairs(peripheral.getNames()) do
  34.     if peripheral.getType(v) == "drive" and
  35.         peripheral.call(v, "hasData") then
  36.         if peripheral.call(v, "getMountPath") == "disk" then
  37.             side = v
  38.             break
  39.         end
  40.     end
  41. end
  42.  
  43. if side then
  44.     peripheral.call(side, "setDiskLabel", "Rescue Boot Disk")
  45. end
  46.  
  47. if term.isColor() then
  48.     term.setTextColor(colors.yellow)
  49. end
  50.  
  51. print("")
  52. print("Installation successful!")
  53. print("Follow these steps to disinfect a computer:")
  54. print("1. Disconnect the computer from any modem networks.")
  55. print("2. Make sure there are no other computers which can access the disk drive.")
  56. print("3. Hold Ctrl + S on the infected computer to shut it down.")
  57. print("4. While the computer is turned off, insert the boot disk.")
  58. print("5. Turn on the computer, and follow on-screen prompts (if any).")
  59. print("")
  60. print("Thanks for using 1lann's rescue boot disk!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement