Advertisement
Marlingaming

CC Tweaked CCSPS Iron - Security - File Checker

Jan 25th, 2022 (edited)
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. local tArg = {...}
  2. local FileName = tArg[1]
  3. local KeyWords = {"os.reboot()","settings.set","settings.clear()","settings.load","pastebin","fs.delete"}
  4. local Accept = true
  5.  
  6. function CheckForKeyWord(Word)
  7. local file = fs.open(FileName,"r")
  8. while true do
  9. local Line = file.readLine()
  10. local _, Search = Line:find(Word)
  11. if Search then
  12. Accept = false
  13. elseif Line then
  14.  
  15. else
  16. break
  17. end
  18. end
  19. file.close()
  20. end
  21.  
  22. for i = 1, #KeyWords do
  23. CheckForKeyWord(KeyWords[i])
  24. end
  25.  
  26. if Accept == false then
  27. fs.delete(FileName)
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement