mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 03:07:43 +02:00
Hotfix Core13 for redirector patch
Movde Core13 Files to 14 Added squid stable20 to Core14 Corrected vdr init file
This commit is contained in:
@@ -1,10 +1,4 @@
|
||||
etc/init.d/mISDN
|
||||
etc/modprobe.d/blacklist
|
||||
usr/bin/bc
|
||||
usr/bin/dc
|
||||
opt/pakfire/lib/functions.pl
|
||||
var/ipfire/urlfilter/bin/prebuild.pl
|
||||
srv/web/ipfire/cgi-bin/urlfilter.cgi
|
||||
srv/web/ipfire/cgi-bin/updatexlrator.cgi
|
||||
srv/web/ipfire/html/images/updxl-src-avg.gif
|
||||
usr/sbin/updxlrator
|
||||
usr/sbin/redirect_wrapper
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
. /opt/pakfire/lib/functions.sh
|
||||
/usr/local/bin/backupctrl exclude >/dev/null 2>&1
|
||||
extract_files
|
||||
/etc/init.d/mISDN config
|
||||
/var/ipfire/urlfilter/bin/prebuild.pl
|
||||
|
||||
@@ -2,3 +2,9 @@ etc/init.d/mISDN
|
||||
etc/modprobe.d/blacklist
|
||||
usr/bin/bc
|
||||
usr/bin/dc
|
||||
etc/squid
|
||||
usr/lib/squid
|
||||
usr/sbin/squid
|
||||
srv/web/ipfire/cgi-bin/updatexlrator.cgi
|
||||
srv/web/ipfire/html/images/updxl-src-avg.gif
|
||||
usr/sbin/updxlrator
|
||||
|
||||
@@ -24,25 +24,29 @@
|
||||
use strict;
|
||||
use IPC::Open2;
|
||||
use IO::Handle;
|
||||
|
||||
# define here your redirectors (use a comma sperated list)
|
||||
my $redirectors = [ '/usr/bin/squidGuard', '/usr/sbin/updxlrator' ];
|
||||
|
||||
require '/var/ipfire/general-functions.pl';
|
||||
|
||||
my %proxysettings=();
|
||||
&General::readhash("${General::swroot}/proxy/settings", \%proxysettings);
|
||||
|
||||
# define here your redirectors (use a comma sperated list)
|
||||
my @redirectors = "";
|
||||
if ( $proxysettings{'ENABLE_FILTER'} eq 'on' && -e '/usr/bin/squidGuard' ){push(@redirectors,"/usr/bin/squidGuard"); }
|
||||
if ( $proxysettings{'ENABLE_CLAMAV'} eq 'on' && -e '/usr/bin/squidclamav' ){ push(@redirectors,"/usr/bin/squidclamav"); }
|
||||
if ( $proxysettings{'ENABLE_UPDXLRATOR'} eq 'on' && -e '/usr/sbin/updxlrator' ) { push(@redirectors,"/usr/sbin/updxlrator"); }
|
||||
|
||||
#my $redirectors = [ '/usr/bin/squidclamav', '/usr/bin/squidGuard', '/usr/sbin/updxlrator' ];
|
||||
if ( $proxysettings{'ENABLE_FILTER'} eq 'on' && $proxysettings{'ENABLE_CLAMAV'} eq 'on' && $proxysettings{'ENABLE_UPDXLRATOR'} eq 'on' ){my $redirectors = [ '/usr/bin/squidGuard', '/usr/bin/squidclamav', '/usr/sbin/updxlrator' ];}
|
||||
if ( $proxysettings{'ENABLE_FILTER'} eq 'on' && $proxysettings{'ENABLE_CLAMAV'} eq 'on' && $proxysettings{'ENABLE_UPDXLRATOR'} eq 'off' ){my $redirectors = [ '/usr/bin/squidGuard', '/usr/bin/squidclamav' ];}
|
||||
if ( $proxysettings{'ENABLE_FILTER'} eq 'on' && $proxysettings{'ENABLE_CLAMAV'} eq 'off' && $proxysettings{'ENABLE_UPDXLRATOR'} eq 'on' ){my $redirectors = [ '/usr/bin/squidGuard', '/usr/sbin/updxlrator' ];}
|
||||
if ( $proxysettings{'ENABLE_FILTER'} eq 'on' && $proxysettings{'ENABLE_CLAMAV'} eq 'off' && $proxysettings{'ENABLE_UPDXLRATOR'} eq 'off' ){my $redirectors = [ '/usr/bin/squidGuard' ];}
|
||||
if ( $proxysettings{'ENABLE_FILTER'} eq 'off' && $proxysettings{'ENABLE_CLAMAV'} eq 'on' && $proxysettings{'ENABLE_UPDXLRATOR'} eq 'on' ){my $redirectors = [ '/usr/bin/squidclamav', '/usr/sbin/updxlrator' ];}
|
||||
if ( $proxysettings{'ENABLE_FILTER'} eq 'off' && $proxysettings{'ENABLE_CLAMAV'} eq 'on' && $proxysettings{'ENABLE_UPDXLRATOR'} eq 'off' ){my $redirectors = [ '/usr/bin/squidclamav' ];}
|
||||
if ( $proxysettings{'ENABLE_FILTER'} eq 'off' && $proxysettings{'ENABLE_CLAMAV'} eq 'off' && $proxysettings{'ENABLE_UPDXLRATOR'} eq 'on' ){my $redirectors = [ '/usr/sbin/updxlrator' ];}
|
||||
|
||||
# Attention: keep in mind that the order of your redirectors is important.
|
||||
# It doesn't make sense to scan for viruses on pages you restrict access to...
|
||||
# So place first your tools which restrict access, then the tools which do the
|
||||
# content filtering!
|
||||
|
||||
#print "Anzahl ".$#redirectors."\n";
|
||||
|
||||
##### no need to change anything below this line #####
|
||||
|
||||
@@ -52,24 +56,34 @@ STDOUT->autoflush(1);
|
||||
my $line;
|
||||
my $return;
|
||||
my $i;
|
||||
my $debug=0; # enable only for debugging
|
||||
|
||||
# open progamms
|
||||
my $pidlist = [];
|
||||
my $rlist = [];
|
||||
my $wlist = [];
|
||||
for($i = 1; $i <= $#redirectors; $i++) {
|
||||
#print "i=".$i." redirector ".$redirectors[$i]."\n";
|
||||
$pidlist->[$i] = open2($rlist->[$i], $wlist->[$i], $redirectors[$i] );
|
||||
for($i = 0; $i < @$redirectors; $i++) {
|
||||
$pidlist->[$i] = open2($rlist->[$i], $wlist->[$i], $redirectors->[$i]);
|
||||
}
|
||||
|
||||
# wait for data...
|
||||
while($line = <>) {
|
||||
for($i = 1; $i <= $#redirectors; $i++) {
|
||||
for($i = 0; $i < @$redirectors; $i++) {
|
||||
$wlist->[$i]->print($line);
|
||||
$return = $rlist->[$i]->getline;
|
||||
last if($return ne "\n" and $return ne $line);
|
||||
# break if redirector changes data
|
||||
}
|
||||
print $return;
|
||||
|
||||
if ($debug){
|
||||
chomp $line;
|
||||
chomp $return;
|
||||
if ( $line ne $return ){
|
||||
open(DATEI, ">>/var/log/squid/redirector_debug") || die "Unable to acces file /var/log/redirector_debug";
|
||||
print DATEI "Requested ".$line."\nAnswer ".$return."\n";
|
||||
close(DATEI);
|
||||
}
|
||||
}
|
||||
}
|
||||
exit 0;
|
||||
|
||||
Reference in New Issue
Block a user