Advertisement
systox

locker

Jun 16th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. print("installer started!")
  2. administrator = "admin-unlock"
  3.  
  4. local function command(c)
  5. return function(...)
  6. -- it could be like this, if we didn't care about intercepting I/O
  7. os.execute(c, ...)
  8. end
  9. end
  10.  
  11. function cmd(c)
  12. if c then
  13. term.setTextColor(colors.green)
  14. print(textutils.serialize(c))
  15. else
  16. term.setTextColor(colors.red)
  17. end
  18. command(c)
  19. end
  20.  
  21. function cc()
  22. term.clear()
  23. term.setCursorPos(1,1)
  24. end
  25.  
  26. fs.makeDir("system")
  27. fs.makeDir("system/data")
  28. fs.makeDir("system/backup")
  29. fs.makeDir("system/features")
  30. fs.makeDir("system/installer")
  31.  
  32. cmd(shell.run("pastebin get dPdpXBx2 system/features/disable"))
  33.  
  34. cmd(shell.setAlias("pastebin","system/pastebin"))
  35. cmd(shell.setAlias("edit","system/edit"))
  36. cmd(shell.setAlias("cd","system/cd"))
  37. cmd(shell.setAlias("copy","system/copy"))
  38. cmd(shell.setAlias("delete","system/delete"))
  39. cmd(shell.setAlias("move","system/move"))
  40. cmd(shell.setAlias("reboot","system/reboot"))
  41. cmd(shell.setAlias("shutdown","system/shutdown"))
  42. cmd(shell.setAlias("programs","system/programs"))
  43. cmd(shell.setAlias("label","system/label"))
  44. cmd(shell.setAlias("run","system/run"))
  45. cmd(shell.setAlias("shell","system/shell"))
  46. cmd(shell.setAlias("lua","system/lua"))
  47.  
  48.  
  49. cmd(shell.run ("set bios.use_multishell false"))
  50. cmd(shell.run ("set shell.autocomplete false"))
  51. cmd(shell.run ("set shell.allow_disk_startup false"))
  52. cmd(shell.run ("set shell.allow_startup true"))
  53. cmd(shell.run ("set lua.autocomplete false"))
  54. cmd(shell.run ("set edit.autocomplete false"))
  55.  
  56. cmd(shell.clearAlias("mv"))
  57. cmd(shell.clearAlias("dir"))
  58. cmd(shell.clearAlias("foreground"))
  59. cmd(shell.clearAlias("background"))
  60. cmd(shell.clearAlias("rm"))
  61. cmd(shell.clearAlias("rs"))
  62. cmd(shell.clearAlias("cp"))
  63. cmd(shell.clearAlias("sh"))
  64. cmd(shell.clearAlias("clr"))
  65. cmd(shell.clearAlias("ls"))
  66.  
  67. cmd(shell.setAlias(administrator..".edit","edit"))
  68. cmd(shell.setAlias(administrator..".move","move"))
  69. cmd(shell.setAlias(administrator..".shell","shell"))
  70. cmd(shell.setAlias(administrator..".delete","delete"))
  71. cmd(shell.setAlias(administrator..".lua","lua"))
  72. cmd(shell.setAlias(administrator..".rm","system/features/disable"))
  73.  
  74.  
  75. f = fs.open("system/data/administrator.dat","w")
  76. f.writeLine(administrator)
  77. f.close()
  78.  
  79.  
  80. cc()
  81. term.setTextColor(colors.lightBlue)
  82. print("SaveOS started!")
  83. term.setTextColor(colors.white)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement