Advertisement
Vilsol

VoidOS Installation

Jul 30th, 2013
7,649
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 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.     error()
  4. end
  5.  
  6. if(not http)then
  7.     print("VoidOS requires HTTP Api to run!")
  8.     error()
  9. end
  10.  
  11. function downloadFile(path, url)
  12.     print("Downloading: " .. path)
  13.     data = http.get(url).readAll()
  14.     file = assert(io.open(path, "w"))
  15.     file:write(data)
  16.     file:close()
  17. end
  18.  
  19. if(fs.exists("/void"))then
  20.     fs.delete("/void")
  21. end
  22.  
  23. if(fs.exists("startup"))then
  24.     fs.delete("startup")
  25. end
  26.  
  27. fs.makeDir("/void")
  28.  
  29. downloadFile("/void/installer", "https://github.com/Vilsol/VoidOS/raw/master/void/installer")
  30.  
  31. shell.run("/void/installer")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement