Advertisement
TehChikenHater

ChikenOS

Jul 20th, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.95 KB | None | 0 0
  1. shell.run("cd /")
  2.  
  3. function createOSDir()
  4.     shell.run("mkdir ChikenOS")
  5.     startup()
  6. end
  7.  
  8. function firstSetup()
  9.     shell.run("clear")
  10.  
  11.     if (not fs.exists("Data")) then
  12.         shell.run("mkdir Data")
  13.         os.sleep(0.1)
  14.         firstSetup()
  15.     end
  16.     if (not fs.exists("cTurtleOS")) then
  17.         shell.run("mkdir cTurtleOS")
  18.         os.sleep(0.1)
  19.         firstSetup()
  20.     end
  21.  
  22.     print("cTurtleOS 1.0")
  23.     print("Enter a computer name: ")
  24.     local computerName = read()
  25.    
  26.     shell.run("label set "..computerName)
  27.     print("You have set the computer name to: \""..os.getComputerLabel().."\"")
  28.  
  29. end
  30.  
  31. function continueSession()
  32.  
  33. end
  34.  
  35. function startup()
  36.     if (not fs.exists("ChikenOS")) then
  37.         createOSDir()
  38.     end
  39.  
  40.     shell.run("cd ChikenOS")
  41.     local canContinue = true
  42.  
  43.     if (not fs.exists("Data")) then
  44.         canContinue = false
  45.     end
  46.  
  47.     if (not fs.exists("cTurtleOS")) then
  48.         canContinue = false
  49.     end
  50.  
  51.     if (canContinue) then
  52.         continueSession()
  53.     else
  54.         firstSetup()
  55.     end
  56. end
  57. startup()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement