Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- https://github.com/kikito/inspect.lua/blob/master/inspect.lua
- local shell = require("shell")
- local arg,ops = shell.parse(...)
- print(ops["r"])
- if arg[1]==nil then
- set = io.open("set","r")
- arg[1]=set:read()
- else
- set = io.open("set","w")
- set:write(arg[1])
- end
- local internet = require("internet")
- local handle = internet.request("http://192.168.31.38:3000/programs/"..arg[1])
- local result = ""
- for chunk in handle do result = result..chunk end
- -- Print the body of the HTTP response
- file = io.open(arg[1],"w")
- file:write(result)
- file:close()
- if ops["r"] then
- shell.execute(arg[1])
- end
Advertisement
Add Comment
Please, Sign In to add comment