Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not fs.exists("/upd_url") then
- print("Enter filename:")
- local url = "http://immibis.com/ccfiles/" .. read()
- local c = http.get(url)
- if not c then error("failed to download "..url, 0) end
- c.close()
- local f = fs.open("/upd_url","w")
- f.write(url)
- f.close()
- end
- local f = fs.open("/upd_url", "r")
- local url = f.readAll()
- f.close()
- local c = http.get(url)
- if c then
- local d = c.readAll()
- c.close()
- local f = fs.open("/upd_code", "w")
- f.write(d)
- f.close()
- else
- print("Download failed from "..url)
- end
- shell.run("/upd_code")
Advertisement
Add Comment
Please, Sign In to add comment