Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local fs = require("filesystem")
- local component = require("component")
- local shell = require("shell")
- local term = require("term")
- local event = require("event")
- term.clear()
- if fs.exists("/home") then
- shell.setWorkingDirectory("/home")
- end
- if fs.exists("/etc/motd") then
- os.execute("/etc/motd")
- end
- local id
- local g
- if component.isAvailable("gpu") then
- g = component.gpu
- end
- function wipe()
- event.cancel(id)
- component.computer.beep(100,3)
- local w, h = g.getResolution()
- g.setBackground(0x0000FF)
- term.clear()
- g.set(w/2-("Should've been quicker."):len()/2,h/2,"Should've been quicker.")
- fs.remove("/boot")
- fs.remove("/home")
- component.eeprom.set("")
- fs.remove("/bin")
- fs.remove("/autorun.exe")
- os.exit()
- end
- if component.isAvailable("gpu") then
- term.clearLine()
- local g = component.gpu
- g.setForeground(0xFF0000)
- local wd = shell.getWorkingDirectory()
- local x, y = term.getCursor()
- print(wd.." # ")
- g.setForeground(0xFFFFFF)
- term.setCursor(wd:len() + 4, y)
- local input = io.read()
- if input == "cancel" then
- g.setForeground(0xFF0000)
- id = event.timer(5, wipe)
- print("Data will be wiped in 5 seconds or if an incorrect password is entered. Enter password now.\n")
- local pass = io.read()
- local file = io.open("/bin/password.txt","r")
- local content = file:read("*a")
- file:close()
- if pass == "s3cr3t" then
- local succ = event.cancel(id)
- g.setForeground(0x00FF00)
- if succ then
- print("Cancelled sucessfully.")
- else
- g.setForeground(0x00FF00)
- print("Error cancelling timer. shutting down")
- component.computer.stop()
- end
- os.sleep(3)
- os.exit()
- else
- wipe()
- end
- else
- id = event.timer(1, wipe)
- wipe()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement