Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function command(c)
- return function(...)
- -- it could be like this, if we didn't care about intercepting I/O
- os.execute(c, ...)
- end
- end
- function cmd(c)
- if c then
- term.setTextColor(colors.green)
- print(textutils.serialize(c))
- else
- term.setTextColor(colors.red)
- end
- command(c)
- end
- v = os.version()
- vers = string.sub(v,string.find(v,"%d+.%d+"))
- if vers ~= "1.5" then
- version = true
- else
- version = false
- end
- file = fs.open("system/data/administrator.dat","r")
- admin = file.readAll()
- file.close()
- print("Admin command is: "..admin)
- print("removing!")
- sleep(2)
- if version then
- cmd(shell.run ("set edit.autocomplete true"))
- cmd(shell.run ("set allow_disk_startup true"))
- cmd(shell.run ("set shell.autocomplete true"))
- cmd(shell.run ("set shell.allow_disk_startup true"))
- cmd(shell.run ("set bios.use_multishell true"))
- cmd(shell.run ("set shell.allow_startup true"))
- cmd(shell.run ("set lua.autocomplete true"))
- cmd(shell.run ("set allow_startup true"))
- end
- cmd(shell.setAlias("pastebin","pastebin"))
- cmd(shell.setAlias("edit","edit"))
- cmd(shell.setAlias("cd","cd"))
- cmd(shell.setAlias("copy","copy"))
- cmd(shell.setAlias("delete","delete"))
- cmd(shell.setAlias("move","move"))
- cmd(shell.setAlias("reboot","reboot"))
- cmd(shell.setAlias("shutdown","shutdown"))
- cmd(shell.setAlias("programs","programs"))
- cmd(shell.setAlias("label","label"))
- cmd(shell.setAlias("run","run"))
- cmd(shell.setAlias("shell","shell"))
- cmd(shell.setAlias("lua","lua"))
- if version then
- -- Set default settings
- settings.set( "shell.allow_startup", true )
- settings.set( "shell.allow_disk_startup", (commands == nil) )
- settings.set( "shell.autocomplete", true )
- settings.set( "edit.autocomplete", true )
- settings.set( "lua.autocomplete", true )
- settings.set( "list.show_hidden", false )
- if term.isColour() then
- settings.set( "bios.use_multishell", true )
- end
- end
- shell.run("remove system/backup/startup")
- shell.run("move startup system/backup")
- print("removed! the pc will restart now")
- sleep(2)
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement