Print the List of refused IP in Console

You can share your Lua Scripts with everybody here.

Print the List of refused IP in Console

Postby Broemmelhaus » Wed Apr 06, 2016 12:01 pm

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
Broemmelhaus
 
6
 
Tue Nov 29, 2011 12:00 pm
Location: Bonn, Germany

Re: Print the List of refused IP in Console

Postby FTP » Wed Apr 06, 2016 3:55 pm

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
FTP
Site Admin
 
1876
 
Tue Sep 29, 2009 6:09 am


Return to Lua scripts

Who is online

Users browsing this forum: Google [Bot] and 2 guests