Advertisement
Shuudoushi

WIP

Jun 2nd, 2015
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.28 KB | None | 0 0
  1. local computer = require("computer")
  2. local fs = require("filesystem")
  3. local kb = require("keyboard")
  4. local shell = require("shell")
  5. local term = require("term")
  6. local io = require("io")
  7.  
  8. local function greeting()
  9. term.clear()
  10. term.setCursor(1,1)
  11.     print("Welcome to the OpenOS_Plus installer!")
  12.     print("This installer will help guide you through setting up and installing OpenOS_Plus")
  13.     print("Press any key to continue.")
  14. local event = event.pull("key_down")
  15.     if event then
  16.         term.clear()
  17.         term.setCursor(1,1)
  18.         downLoad()
  19.     end
  20. end
  21.  
  22. local function downLoad()
  23.     term.write("Please wait while the files are downloaded and installed.")
  24.     term.setCursor(1,2)
  25. shell.execute("wget -f https://raw.githubusercontent.com/Shuudoushi/OpenOS_Plus/master/autorun.lua")
  26.     os.sleep(5)
  27.     term.setCursor(1,4)
  28. shell.execute("wget -f https://raw.githubusercontent.com/Shuudoushi/OpenOS_Plus/master/lib/superauth.lua /lib/superauth.lua")
  29.     os.sleep(5)
  30.     term.setCursor(1,6)
  31. shell.execute("wget -f https://raw.githubusercontent.com/Shuudoushi/OpenOS_Plus/master/bin/logout.lua /bin/logout.lua")
  32.     os.sleep(5)
  33.     term.setCursor(1,8)
  34. shell.execute("wget -f https://raw.githubusercontent.com/Shuudoushi/OpenOS_Plus/master/bin/usage.lua /bin/usage.lua")
  35.     os.sleep(5)
  36.     term.setCursor(1,10)
  37. shell.execute("wget -f https://raw.githubusercontent.com/Shuudoushi/OpenOS_Plus/master/bin/.root.lua /bin/.root.lua")
  38.     os.sleep(5)
  39.     term.setCursor(1,12)
  40. shell.execute("wget -f https://raw.githubusercontent.com/Shuudoushi/OpenOS_Plus/master/bin/update.lua /bin/update.lua")
  41.     os.sleep(5)
  42.     term.setCursor(1,14)
  43. end
  44.  
  45. local function userInfo()
  46.     term.clear()
  47.     term.setCursor(1,1)
  48.     term.write("Please enter a username. Usernames must be lowercase.")
  49.     term.setCursor(1,2)
  50.     term.write("Username: ")
  51.         username = term.read()
  52.         username = string.gsub(username, "\n", "")
  53.     term.setCursor(1,3)
  54.     term.write("Password: ")
  55.         password = term.read(nil, nil, nil, "")
  56.         password = string.gsub(password, "\n", "")
  57.  
  58.     u = io.open("/userName.dat", "w")
  59.         u:write(username)
  60.             u:close()
  61.     p = io.open("/passWord.dat", "w")
  62.         p:write(password)
  63.             p:close()
  64.  
  65.     u = io.open("/userName.dat", "r")
  66.         testu = u:read()
  67.             u:close()
  68.  
  69.     if not fs.exist("/usr/home/" .. testu .. "/")
  70.         fs.makeDirectory("/usr/home/" .. testu .. "/")
  71.     end
  72. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement