Page 1 of 1

Print the List of refused IP in Console

Posted: Wed Apr 06, 2016 12:01 pm
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

Re: Print the List of refused IP in Console

Posted: Wed Apr 06, 2016 3:55 pm
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