Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- if not args[1] then
- printError("Usage: download <file> [file]")
- return
- end
- h = http.get("https://raw.github.com/jakemroman/JakeHub/master/"..args[1])
- if not h then
- printError("Unknown file")
- return
- else
- local prog = h.readAll()
- h.close()
- if not args[2] then
- f = fs.open("/startup","w")
- f.writeLine(prog)
- f.close()
- print("Downloaded.")
- else
- f = fs.open(args[2],"w")
- f.writeLine(prog)
- f.close()
- print("Downloaded as "..args[2])
- end
- end
Add Comment
Please, Sign In to add comment