Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args={...}
- if not #args==1 then
- error("Usage: ccbox [folder]",0)
- end
- --Download Required API's
- print("Updating...")
- local apis={}
- apis.redirect="https://raw.github.com/Sxw1212/ccprograms/master/gopher/redirect"
- apis.goroutine="https://raw.github.com/Sxw1212/ccprograms/master/gopher/goroutine"
- apis.chrootapi="https://raw.github.com/Sxw1212/ccprograms/master/chrootapi"
- if not fs.isDir("/.ccbox") then
- fs.delete("/.ccbox")
- fs.makeDir("/.ccbox")
- end
- for k,v in pairs(apis) do
- local req=http.get(v)
- if req then
- fs.delete("/.ccbox/"..k)
- local fh=fs.open("/.ccbox/"..k,"w")
- fh.write(req.readAll())
- fh.close()
- os.loadAPI("/.ccbox/"..k)
- else
- error("Updating failed for "..k, 0)
- end
- end
- local updateurl="https://raw.github.com/Sxw1212/ccprograms/master/ccboxupd"
- local req=http.get(updateurl)
- if req then
- fs.delete("/.ccbox/ccboxupd")
- local fh=fs.open("/.ccbox/ccboxupd","w")
- fh.write(req.readAll())
- fh.close()
- else
- error("Updating failed for ccboxupd", 0)
- end
- print("Lauching...")
- vmpath=args[1]
- if shell then
- args[1]=shell.resolve(args[1])
- end
- os.run({}, "/.ccbox/ccboxupd", unpack(args))
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- print("CCBox has exited")
Advertisement
Add Comment
Please, Sign In to add comment