Gestione gruppi proxy

This commit is contained in:
cmaffio
2016-05-17 16:50:51 +02:00
parent 6d7923c5d5
commit d3a75524fa
15 changed files with 256 additions and 41 deletions

View File

@@ -9,7 +9,7 @@ require "$Bin/../script/conntrack.conf";
local $SIG{ALRM} = sub {
my $time = localtime; # scalar context
print LOG "$$ - $time - Exit\n";
# print LOG "$$ - $time - Exit\n";
exit 1;
};
@@ -21,8 +21,8 @@ my $dbmysql = DBI->connect("DBI:mysql:;host=$DBhost", $DBuser, $DBpass) or die (
$sts = $dbmysql->prepare("use $DBname");
$sts->execute ();
open LOG, ">> /srv/www/htdocs/pannello_vbc/proxy/squid_acl/squid_pool.log";
LOG->autoflush(1);
#open LOG, ">> /srv/www/htdocs/pannello_vbc/proxy/squid_acl/squid_pool.log";
#LOG->autoflush(1);
while($limit) {
alarm $timeout;
@@ -35,15 +35,15 @@ while($limit) {
my $ritorno = cerca ($param[1],$param[2], -1);
$limit--;
if ($ritorno) {
print LOG "$param[0] - $param[1] - $param[2] - ERR\n";
# print LOG "$param[0] - $param[1] - $param[2] - ERR\n";
print "DENY\n";
} else {
$ritorno = cerca ($param[1],$param[2], 1);
if ($ritorno) {
print LOG "$param[0] - $param[1] - $param[2] - OK\n";
# print LOG "$param[0] - $param[1] - $param[2] - OK\n";
print "OK\n";
} else {
print LOG "$param[0] - $param[1] - $param[2] - ERR\n";
# print LOG "$param[0] - $param[1] - $param[2] - ERR\n";
# print "DENY\n";
print "\n";
}