Print the List of refused IP in Console

You can share your Lua Scripts with everybody here.
Post Reply
Broemmelhaus
Posts: 12
Joined: Tue Nov 29, 2011 12:00 pm
Location: Bonn, Germany

Print the List of refused IP in Console

Post by Broemmelhaus »

Hello,

I'm trying to print the List of refused IP by using c_GetGlobalIPMaskList() but everything I tried Ends up in an error: "string expected, got table" or "string expected, got nil"

How do I print this Information in the administration console?
Thx for your help!

Meik
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: Print the List of refused IP in Console

Post by FTP »

OK, here is an example to print the global IP access rules:

Code: Select all

local ipmasks = c_GetGlobalIPMaskList()
if type(ipmasks) == "table" then
   for _,ipmask in pairs(ipmasks) do

      if ipmask.refuse then
	print("Denied IP: "..ipmask.ip.."\n")
      else
	print("Allowed IP: "..ipmask.ip.."\n")
      end

   end
end
Post Reply