Re: [squid-users] More than one type of redirector

From: Daniel Barron <[email protected]>
Date: Tue, 03 Jul 2001 17:03:49 +0100

In message <Pine.BSF.4.33.0106270847590.93837-100000@guru.citec.qld.gov.au> you wrote:

> Hi,
>
> I don't have your original email. How were you calling them from squid?
> Despite what is implied you cannot define the authentication program as
>
> redirect_program blah1 | blah2
>
> You can't even pass args. Apparently this is a known feature. You'll have
> to (if you haven't already) stick it in a shell script wrapper, eg
>
> redirect_program redirect_wrapper
>
> where redirect_wrapper is something like
>
> #! /bin/sh
> program1 | program2
>
> Colin

Yes, this is what I have done and it does not work. Here is a copy of my
original email:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Date: Mon, 25 Jun 2001 14:07:46 +0100
From: Daniel Barron <squidusers@beebug.co.uk>
To: squid-users@squid-cache.org
Subject: Re: [squid-users] More than one type of redirector

In message <3B33E4AF.E2C6A26@hem.passagen.se>
 Henrik Nordstrom <hno@hem.passagen.se> did write:

> Pipe them together.
>
> I.e. create your own custom redirector in the form of a small shell
> script
>
> #!/bin/sh
> redirector1 | redirector2
>
> --
> Henrik Nordstrom
> Squid Hacker

Oh no! It won't work. What I've got is the following:

/etc/squid/redirector.sh:
#!/bin/sh
/usr/local/bin/squidGuard -c /etc/squidGuard/conf/squidGuard.conf | /etc/squid/redirector.pl

/etc/squid/redirector.pl:
#!/usr/bin/perl
$|=1;
while (<>) {
        s@http://www.bedmod.org.uk@http://www.bedmod.org.uk/index2.html@;
        print;
}

And in squid.conf:
redirect_program /etc/squid/redirector.sh
redirect_children 5

Both redirector scripts are owned by squid.

squidGuard seems to still work. But the perl redirector won't work when
piped together, but it will run from the command line.

I've tried piping the perl to squidGuard and it still does not work.

Where am I going wrong?

-- 
Daniel Barron
Received on Tue Jul 03 2001 - 10:17:21 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:01:00 MST