Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- -- Help
- local function printUsage()
- print([[
- installer <mode>
- Modes:
- on-demand: only installs the On-Demand Scanner
- rts: only installs the Real-Time Security Driver
- suite: installs the entire suite
- ]])
- end
- -- The actual function replacing pastebin
- local function getData(code)
- local file = http.get("http://pastebin.com/raw/"..code)
- local contents = file.readAll()
- file.close()
- return contents
- end
- -- A FS wrapper
- local function save(data, path)
- if not fs.exists(path) then
- local h = fs.open(path, "w")
- h.write(data)
- h.close()
- return true
- else
- printError("FIle already exists!")
- return false
- end
- end
- -- GUI (kind of)
- local function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- local function drawProgress(txt, y)
- term.setCursorPos(4, 4)
- print(txt)
- term.setCursorPos(1, y)
- print("[ ]")
- term.setCursorPos(2, y)
- textutils.slowPrint("==============================]", 10)
- print("Done!")
- end
- local function draw()
- print("ReactOS AntiMalware Suite | Installer ")
- print("___________________________________________________")
- end
- -- Main code
- clear()
- draw()
- if #args < 1 then
- printUsage()
- else
- if args[1] == "on-demand" then
- drawProgress("Downloading BLAST On-Demand Scanner.", 6)
- save(getData("pUG2n5Hb"), "scan")
- elseif args[1] == "rts" then
- drawProgress("Downloading BLAST Real-Time Security Driver.", 6)
- save(getData("gZvWiXJ7"), "rts")
- elseif args[1] == "suite" then
- drawProgress("Downloading BLAST AntiMalware Suite.", 6)
- save(getData("pUG2n5Hb"), "scan")
- save(getData("gZvWiXJ7"), "rts")
- else
- printUsage()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment