Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- verze = "21.1027.R1"
- term.setCursorPos(1,1)
- term.setBackgroundColor(colors.black)
- term.clear()
- print("Antivirus system EZET")
- local function txc(barvaP) term.setTextColor(barvaP) end
- function kontrola()
- local data = fs.open(cesta, "r")
- local obsah = data.readAll()
- data.close()
- if not vir then
- if string.find(obsah,"startup") then vir = true
- end
- end
- print()
- write("Soubor "..cesta.." ")
- if vir then txc(colors.orange) print"Mozne riziko!" kontrola2() else txc(colors.green) print"soubor je OK" end
- print()
- cteni()
- end
- function kontrola2()
- local i = 0
- local radek ={}
- local data = fs.open(cesta, "r")
- repeat
- vir = false
- i = i + 1
- radek[i] = data.readLine()
- if radek[i] then
- if (string.find(radek[i],"startup") or (string.find(radek[i],"startup.lua"))) and string.find(radek[i],"delete") and not string.find(radek[i],"startuplog") then vir = true
- txc(colors.red) print("Strikne zakazano!")
- else
- txc(colors.white)
- end
- if not vir then
- if string.find(radek[i],"startup") then vir = true
- end
- end
- if vir then print("Radek:["..i.."]: "..radek[i] ) end
- end
- until radek[i] == nil
- data.close()
- end
- function cteni()
- txc(colors.white)
- write("Cesta programu: ")
- vir = false
- cesta = read()
- if fs.isDir(cesta) then txc(colors.yellow) print("Slozku nelze kontrolovat!") cteni()
- elseif cesta == "exit" then error()
- elseif fs.exists(cesta) then kontrola()
- elseif fs.exists(cesta..".lua") then cesta = cesta..".lua" kontrola()
- else txc(colors.yellow) print("Chyba!") cteni()
- end
- end
- cteni()
Add Comment
Please, Sign In to add comment