Advertisement
systox

disable

Jun 16th, 2018
1,239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. local function command(c)
  2. return function(...)
  3. -- it could be like this, if we didn't care about intercepting I/O
  4. os.execute(c, ...)
  5. end
  6. end
  7.  
  8. function cmd(c)
  9. if c then
  10. term.setTextColor(colors.green)
  11. print(textutils.serialize(c))
  12. else
  13. term.setTextColor(colors.red)
  14. end
  15. command(c)
  16. end
  17.  
  18. v = os.version()
  19. vers = string.sub(v,string.find(v,"%d+.%d+"))
  20. if vers ~= "1.5" then
  21. version = true
  22. else
  23. version = false
  24. end
  25.  
  26. file = fs.open("system/data/administrator.dat","r")
  27. admin = file.readAll()
  28. file.close()
  29.  
  30.  
  31. print("Admin command is: "..admin)
  32. print("removing!")
  33. sleep(2)
  34.  
  35. if version then
  36. cmd(shell.run ("set edit.autocomplete true"))
  37. cmd(shell.run ("set allow_disk_startup true"))
  38. cmd(shell.run ("set shell.autocomplete true"))
  39. cmd(shell.run ("set shell.allow_disk_startup true"))
  40. cmd(shell.run ("set bios.use_multishell true"))
  41. cmd(shell.run ("set shell.allow_startup true"))
  42. cmd(shell.run ("set lua.autocomplete true"))
  43. cmd(shell.run ("set allow_startup true"))
  44. end
  45.  
  46. cmd(shell.setAlias("pastebin","pastebin"))
  47. cmd(shell.setAlias("edit","edit"))
  48. cmd(shell.setAlias("cd","cd"))
  49. cmd(shell.setAlias("copy","copy"))
  50. cmd(shell.setAlias("delete","delete"))
  51. cmd(shell.setAlias("move","move"))
  52. cmd(shell.setAlias("reboot","reboot"))
  53. cmd(shell.setAlias("shutdown","shutdown"))
  54. cmd(shell.setAlias("programs","programs"))
  55. cmd(shell.setAlias("label","label"))
  56. cmd(shell.setAlias("run","run"))
  57. cmd(shell.setAlias("shell","shell"))
  58. cmd(shell.setAlias("lua","lua"))
  59.  
  60. if version then
  61. -- Set default settings
  62. settings.set( "shell.allow_startup", true )
  63. settings.set( "shell.allow_disk_startup", (commands == nil) )
  64. settings.set( "shell.autocomplete", true )
  65. settings.set( "edit.autocomplete", true )
  66. settings.set( "lua.autocomplete", true )
  67. settings.set( "list.show_hidden", false )
  68. if term.isColour() then
  69. settings.set( "bios.use_multishell", true )
  70. end
  71. end
  72.  
  73. shell.run("remove system/backup/startup")
  74. shell.run("move startup system/backup")
  75. print("removed! the pc will restart now")
  76. sleep(2)
  77. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement