Aggiunta gestione IP
This commit is contained in:
@@ -102,11 +102,13 @@ sub conntrack {
|
||||
my $proxy_IP = shift;
|
||||
my $proxy_PORT = shift;
|
||||
|
||||
$SIG{INT} = \&end;
|
||||
|
||||
my $conta = 0;
|
||||
|
||||
print "Attivato agente $sess_id su $proxy_IP:$proxy_PORT\n" if ($verbose);
|
||||
|
||||
open CT, "/usr/sbin/conntrack -E -eNEW,DESTROY -otimestamp,id -p tcp -d $proxy_IP --dport $proxy_PORT |" or die "non va\n";
|
||||
my $proc_id = open CT, "/usr/sbin/conntrack -E -eNEW,DESTROY -otimestamp,id -p tcp -d $proxy_IP --dport $proxy_PORT 2>/dev/null |" or die "non va\n";
|
||||
|
||||
while (<CT>) {
|
||||
my $riga = $_;
|
||||
@@ -173,9 +175,13 @@ sub conntrack {
|
||||
$sem2->up();
|
||||
print "Invio query UPDATE\n" if ($verbose > 1);
|
||||
}
|
||||
return if ($conta >= $limit_thread);
|
||||
if ($conta >= $limit_thread) {
|
||||
last;
|
||||
# kill 9, $proc_id;
|
||||
# return
|
||||
}
|
||||
}
|
||||
close CT;
|
||||
kill 9, $proc_id;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user