Search squid archive

RE: bash/mysql script not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Thanx a lot.

This is the outcome. Finally it works

while read url
if [ `echo "select site from porn where site='$url'"|mysql squid -u squid -psquidpass|grep -v "site"` ]
echo OK
echo ERR

But this is really not what I´m looking for. This scrip only compares what´s coming in from squid with what´s in the mysql table. That means that if the url is not exactly the same as the request it really does not work. So I´m looking to make something that works more like a url_regex acl that takes an element in the mysql table and sees if the request's url contains that element. With this working I'm sure it would make more sense since the comparisons would succeed without the need to fillup the table with millions of urls that otherwise would be blocked with just a limited number of strings

-----Mensaje original-----
De: Andrew Beverley [mailto:andy@xxxxxxxxxxx] 
Enviado el: Monday, April 02, 2012 3:45 PM
Para: Osmany Goderich
CC: squid-users@xxxxxxxxxxxxxxx
Asunto: Re:  bash/mysql script not working

On Mon, 2012-04-02 at 14:28 -0400, Osmany Goderich wrote:
> Please have a look at this bash/mysql external helper. Can anyone tell 
> me why is it not working?
> is there anyway I can test this directly on the server's shell

Yes, just run it on the shell as you would any other script, and input the expected values (as specified in squid.conf) followed by a carriage return. The script should return OK or ERR as appropriate.


[Linux Audio Users]     [Photo]     [Yosemite News]     [Samba]     [Video Projectors]     [Video Devices]     [Big List of Linux Books]     [LCD TVs]     [Webcams]     [Linux USB]

  Powered by Linux