Kick all sessions having "Keep alive"

You can share your Lua Scripts with everybody here.

Kick all sessions having "Keep alive"

Postby Broemmelhaus » Wed Nov 30, 2016 11:11 am

Hello,

I try to Kick all Sessions having "Keep_Alive" as last remark.
The Little Lua-script works very well.

Here's my script:
local strUserlist = {}
strUserlist = c_GetConnectionsList("Domain")
for nr in pairs(strUserlist) do
local letztes = strUserlist[nr].lastcommand
local user = strUserlist[nr].username
if string.find(letztes, 'KEEP ALIVE') then
c_KickSession('Domain',strUserlist[nr].id,0,0,0,0,0,0)
end
end

But I recognized, that WingFTP remarks "Keep alive" for users who's uploads are in still in progress. So the script kicks sessions that shouldn't be "kicked".
Now I tried to use "%ConTransferByte" but I got no values back from the System.

Perhaps someone can help to solve my problem, getting the information, if there is any process (upload/download) in progress.

Thx
Meik
Broemmelhaus
 
6
 
Tue Nov 29, 2011 12:00 pm
Location: Bonn, Germany

Re: Kick all sessions having "Keep alive"

Postby FTP » Thu Dec 01, 2016 12:41 pm

For your requirement, you can solve it via a simple method, just modify the file "webclient/main.html", remove the following line:

_TIMER_KEEPLIVE = setInterval("keeplive()",1000*300);
FTP
Site Admin
 
1876
 
Tue Sep 29, 2009 6:09 am

Re: Kick all sessions having "Keep alive"

Postby Broemmelhaus » Wed Dec 07, 2016 3:47 pm

Thx FTP for the really simple method!

But if I understand it right, this one line will not solve my problem, if there is an upload/download in process. The logs last entry is a "Keep alive" and the up-/download is still running. These sessions shouldn't be kicked off.

Is ist possible to manage?

Or does the remove of "_TIMER_KEEPLIVE = setInterval("keeplive()",1000*300);" solve this too?

Best regards
Meik
Broemmelhaus
 
6
 
Tue Nov 29, 2011 12:00 pm
Location: Bonn, Germany


Return to Lua scripts

Who is online

Users browsing this forum: No registered users and 3 guests

cron