MinePossu

void install

May 6th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.91 KB | None | 0 0
  1. if(not term.isColor or not term.isColor())then
  2.         print("VoidOS Can only run on advanced computers and turtles")
  3.         print("and this can run on advanced pocket computers!")
  4.         error()
  5. end
  6.  
  7. if(not http)then
  8.         print("VoidOS requires HTTP Api to run!")
  9.         error()
  10. end
  11.  
  12. function downloadFile(path, url)
  13.         print("Downloading: " .. path)
  14.         data = http.get(url).readAll()
  15.         file = assert(io.open(path, "w"))
  16.         file:write(data)
  17.         file:close()
  18. end
  19.  
  20. if(fs.exists("/void"))then
  21.         fs.delete("/void")
  22. end
  23.  
  24. if(fs.exists("startup"))then
  25.         fs.delete("startup")
  26. end
  27.  
  28. fs.makeDir("/void")
  29.  
  30. if pocket then
  31.  
  32. downloadFile("/void/installer", "https://pastebin.com/raw/s7AvJqLL")
  33. shell.run("/void/installer")
  34.  
  35. else
  36.  
  37. downloadFile("/void/installer", "https://github.com/Vilsol/VoidOS/raw/master/void/installer")
  38. shell.run("/void/installer")
  39. end
Add Comment
Please, Sign In to add comment