Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColour(colors.lime)
- print("ASS V1.8")
- term.setTextColour(colors.white)
- danger = {"rm startup","rm DISK/startup","rm DISK/","rm /DISK/","rm ./*","rm"}
- function FullScan()
- print("FullScan RUNNING!")
- local files = fs.list("*")
- for i = 1,#files do
- local gitfil = fs.open(files[i], "r")
- if gitfil == nil then
- sleep(0)
- else
- illcom3 = gitfil.readAll()
- gitfil.close()
- for j = 1,#danger do
- if string.match(illcom3, danger[j]) then
- term.setTextColour(colors.red)
- print ("dangerous file found! : "..files[i])
- term.setTextColour(colors.white)
- run1 = false
- end
- end
- end
- end
- sleep(1)
- end
- local function SHELL()
- term.clear()
- term.setCursorPos(1,1)
- print("ENTERING ASS SHELL")
- print("FS for fullscan")
- while true do
- COMMAND = read()
- run1 = true
- for i = 1,#danger do
- if string.match(COMMAND, danger[i]) then
- term.setTextColour(colors.yellow)
- print ("command might be dangerous")
- term.setTextColour(colors.white)
- run1 = false
- end
- end
- local handler = fs.open(COMMAND..".lua", "r")
- if handler == nil then
- handler = fs.open(COMMAND, "r")
- end
- if handler == nil then
- sleep(0)
- else
- illcom = handler.readAll()
- handler.close()
- for i = 1,#danger do
- if string.match(illcom, danger[i]) then
- term.setTextColour(colors.yellow)
- print ("command might be dangerous")
- term.setTextColour(colors.white)
- run1 = false
- end
- end
- local handler = fs.open(COMMAND..".lua", "r")
- if handler == nil then
- handler = fs.open(COMMAND, "r")
- end
- if handler == nil then
- sleep(0)
- else
- local IKE = {"fg","bg","background","foreground","shell.run(","move", "mv"}
- illcom2 = handler.readAll()
- handler.close()
- dofscan = false
- for i = 1,#IKE do
- if string.match(illcom2, IKE[i]) then
- dofscan = true
- end
- end
- if dofscan == true then
- FullScan()
- end
- end
- end
- if run1 == true then
- if COMMAND == "FS" then
- FullScan()
- else
- shell.run(COMMAND)
- end
- end
- end
- end
- print("Run ./startup ? [Y/N/FS]")
- TEmP = read()
- if TEmP == "Y" then
- print("Running startup")
- shell.run("./startup")
- term.setCursorPos(1,1)
- term.clear()
- elseif TEmP == "FS" then
- FullScan()
- end
- SHELL()
- term.setBackgroundColor(colors.blue)
- term.setTextColour(colors.white)
- term.clear()
- term.setCursorPos(1,1)
- print("ASS HAS STOPPED FOR AN UNKNOWN REASON")
- print("KEEP CALM, ASS WILL NOW STOP THE PC")
- sleep(5)
- os.shutdown()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement