Re: [squid-users] external_acl_type

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 15 Nov 2005 17:06:03 +0100 (CET)

On Tue, 15 Nov 2005, Pieter De Wit wrote:

> Hello List,
>
> Can someone please point me to a resource describing what an external
> acl program must return and how. In my quest to "bind" an IP to a
> username I have created the following:
>
> ip_to_user.sh
> #!/bin/bash
>
> while [ 1 ]
> do
> while read ip
> do
> ip_done="0";
>
> echo "Auth'ing $ip..." >> /var/log/ip_to_user.log
>
> if [ $ip = "1.2.3.4" ]; then
> echo "OK user=user"
> echo "OK user=user" >> /var/log/ip_to_user.log
> ip_done="1";
> fi
> done
> done
>
> That seems to work, but at some stage all 5 of them use 100% CPU - even
> when they are not auth'ing.

Drop the outer while loop from the script. This loop causes the script to
never terminate and instead use 100% CPU when it's supposed to terminate..

Regards
Henrik
Received on Tue Nov 15 2005 - 09:06:06 MST

This archive was generated by hypermail pre-2.1.9 : Thu Dec 01 2005 - 12:00:09 MST