Guest User

cb-update

a guest
Sep 21st, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. if not http then
  2.     print "It doesn't seem like you have http enabled."
  3.     print "Enable it first, restart minecraft, then run the installer again."
  4.     return
  5. end
  6.  
  7. local url = "https://raw.github.com/Kingdaro/CraftBang/master/installer"
  8. local instPath = ".cbinstaller"
  9.  
  10. print "Downloading installer"
  11.  
  12. local download = http.get(url)
  13. if download then
  14.     local file = fs.open(instPath, 'w')
  15.     file.write(download.readAll())
  16.     file.close()
  17.     download.close()
  18.  
  19.     shell.run(instPath)
  20.     fs.delete(instPath)
  21.  
  22.     for _,v in pairs(rs.getSides()) do
  23.         disk.eject(v)
  24.     end
  25.  
  26.     write "Restart now? [Y/n] "
  27.     local input = read():lower():sub(1,1)
  28.     if input == 'n' then
  29.         print "I'll let you return to your shell then."
  30.         print "Do what you need to do."
  31.     else
  32.         textutils.slowWrite("Goodbye!")
  33.         sleep(1)
  34.         os.reboot()
  35.     end
  36. else
  37.     print "Couldn't get installer"
  38. end
Add Comment
Please, Sign In to add comment