]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
DHCP-Client initialisiert nun die Firewall korrekt!
authorms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Wed, 11 Jul 2007 13:17:37 +0000 (13:17 +0000)
committerms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Wed, 11 Jul 2007 13:17:37 +0000 (13:17 +0000)
Neues Wrapper-Script fuer multiple Redirectors im Squid.

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@672 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8

config/rootfiles/common/perl
config/urlfilter/redirect_wrapper
src/initscripts/init.d/net/common/dhcpcd
src/scripts/readhash

index ea8046b3ac774d3afb07b19fcf306fd676163137..19377762baf818c0003de7f83a85fe8f5ade25b5 100644 (file)
@@ -223,8 +223,8 @@ usr/lib/perl5/5.8.8/I18N/LangTags/List.pm
 usr/lib/perl5/5.8.8/IO/Socket/INET.pm
 usr/lib/perl5/5.8.8/IO/Socket/UNIX.pm
 #usr/lib/perl5/5.8.8/IPC
-#usr/lib/perl5/5.8.8/IPC/Open2.pm
-#usr/lib/perl5/5.8.8/IPC/Open3.pm
+usr/lib/perl5/5.8.8/IPC/Open2.pm
+usr/lib/perl5/5.8.8/IPC/Open3.pm
 #usr/lib/perl5/5.8.8/List
 usr/lib/perl5/5.8.8/List/Util.pm
 #usr/lib/perl5/5.8.8/Locale
index f81d81a3895c536a301375d179805f800bd2690f..a2be304b7d43b4234dcc5cde289c47dc8c08b6ca 100644 (file)
@@ -1,2 +1,67 @@
-#!/bin/sh
-/usr/bin/squidGuard | /usr/sbin/updxlrator
+#!/usr/bin/perl
+
+###############
+#
+#     This is free software; you can redistribute it and/or modify
+#     it under the terms of the GNU General Public License as published by
+#     the Free Software Foundation; either version 2 of the License, or
+#     (at your option) any later version.
+#
+#     It is distributed in the hope that it will be useful,
+#     but WITHOUT ANY WARRANTY; without even the implied warranty of
+#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#     GNU General Public License for more details.
+#
+#     You should have received a copy of the GNU General Public License
+#     along with SquiVi2; if not, write to the Free Software
+#     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#     Copyright 2004 Steffen Schoch (sschoch@users.sourceforge.net)
+#     Modified by Michael Tremer for www.ipfire.org (mitch@ipfire.org, 2007)
+#
+###############
+
+# Version
+my $VERSION = '1.0';
+
+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', ];
+
+# 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!
+
+
+##### no need to change anything below this line #####
+
+# init
+$| = 1;
+STDOUT->autoflush(1);
+my $line;
+my $return;
+my $i;
+
+# open progamms
+my $pidlist = [];
+my $rlist = [];
+my $wlist = [];
+for($i = 0; $i < @$redirectors; $i++) {
+        $pidlist->[$i] = open2($rlist->[$i], $wlist->[$i], $redirectors->[$i]);
+}
+
+# wait for data...
+while($line = <>) {
+        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;
+}
+exit 0;
index bad2877ce42b810c129c7f543340746ebe397c1f..b96f06c890d642977d953bc5f360706f4367565a 100644 (file)
@@ -35,7 +35,7 @@ case "$2" in
                        /sbin/iptables -A REDINPUT -p udp --source-port 67 --destination-port 68 -i ${1} -j ACCEPT
                fi
                
-               DHCP_START="-N -R -L /var/ipfire/dhcpc "
+               DHCP_START="-N -R -L /var/ipfire/dhcpc -c /var/ipfire/dhcpc/dhcpcd.exe "
                
                if [ -n "${DHCP_HOSTNAME}" ]; then
                        DHCP_START+="-h ${DHCP_HOSTNAME} "
@@ -91,7 +91,7 @@ case "$2" in
                # Do nothing with the client daemon if we have an infinate 
                # lease time as the client exits when started in this case,
                # just echo OK.
-               DHCP_STOP="-k"
+               DHCP_STOP="-k -c /var/ipfire/dhcpc/dhcpcd.exe "
                if [ -e $LEASEINFO ]
                then
                        . $LEASEINFO
index b2d541d10ffc79a5459a73bf232f962738bbc0b2..63a3e0f88d8b8ad5227a1a0989df73fa7e9006f2 100644 (file)
@@ -16,7 +16,7 @@ VARNAME='[A-Za-z_][A-zA-z0-9_]*'
 VARCHARS='A-Za-z0-9=/,._@#+-'
 VARVAL="[${VARCHARS}]*"
 
-sed -ne "s/^\(${VARNAME}\)=\(${VARVAL}\)$/\1=\2/p" $1
+sed -ne "s/\(${VARNAME}\)=\(${VARVAL}\)$/\1=\2/p" $1
 
 # Accept space only if it's quoted
-sed -ne "s/^\(${VARNAME}\)=\('[ ${VARCHARS}]*'\)$/\1=\2/p" $1
+sed -ne "s/\(${VARNAME}\)=\('[ ${VARCHARS}]*'\)$/\1=\2/p" $1