Nothy

U1-Installer

Mar 7th, 2016
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.16 KB | None | 0 0
  1. if not fs.exists("pocke") then
  2.   print("Installing U1 Pre-Alpha")
  3. else
  4.   print("Updating U1 Pre-Alpha")
  5. end
  6. if not http then
  7.   print("HTTP not enabled! Make sure you enable it in the server configuration!")
  8. end
  9. function download(url, file)
  10.   print("Downloading "..file)
  11.   local fdl = http.get(url)
  12.   if not fdl then
  13.     print("Failed to connect! Are you connected to the internet?")
  14.   end
  15.   local f = fs.open(file,"w")
  16.   print("Opening file "..file)
  17.   f.write(fdl.readAll())
  18.   f.close()
  19.   print("Written to file "..file)
  20. end
  21. download("https://www.dropbox.com/s/k15800l0dkhirmo/startup?dl=1","startup")
  22. download("https://www.dropbox.com/s/6exvxj3l60vs8r5/os.lua?dl=1","pocke/os.lua")
  23. download("https://www.dropbox.com/s/hbmt6bf1tjl8z4z/settings?dl=1","pocke/api/settings")
  24. download("https://www.dropbox.com/s/rxxg8cxhoe83h2o/edge?dl=1","pocke/api/edge")
  25. download("https://www.dropbox.com/s/48ca6yjrsecsnd7/crash?dl=1","pocke/user/crash")
  26. download("https://www.dropbox.com/s/i18p42ph8blylfm/settings.cfg?dl=1","pocke/settings.cfg")
  27. download("https://www.dropbox.com/s/ed57owqqjp53l57/installer?dl=1","pocke/user/updater")
  28. print("Rebooting.")
  29. sleep(3)
  30. os.reboot()
Add Comment
Please, Sign In to add comment