Re: [squid-users] Configuring authentication with ldap_auth and two domains?

From: D & E Radel <radel@dont-contact.us>
Date: Sun, 17 Apr 2005 11:27:28 +1200

> Hello grolschie,
>
> i now have tested the script in a working environment.
> At my site the script didn't work also.
> The first problem was the string compare.
> I only glanced at the script, so I didn't see the mistake.
> In the future you should do string compares always in this way:
>
> if [ "$DOMAIN1" == "OK" ]; then
> ...
>
> Note on the spaces and the quotation marks.
>
> The second problem was the way of reading the input from stdin.
> I have here a complete script which should also work at your site.
>
> -------------------------------------------------------
> #!/bin/sh
>
> # read from stdin until EOF is received
> while read INP; do
> DOMAIN1=`echo $INP | /usr/lib/squid/ldap_auth ...`
> DOMAIN2=`echo $INP | /usr/lib/squid/ldap_auth ...`
>
> if [ "$DOMAIN1" == "OK" ]; then
> echo "OK"
> elif [ "$DOMAIN2" == "OK" ]; then
> echo "OK"
> else
> echo "ERR"
> fi
> done
> -------------------------------------------------------
>
> I hope this helps.
> Please let me know your results.
>
> Regards
> Matthias

Hi Matthias.

Thank you very much for going out of your way to help me. I really do
appreciate it. :-)

Ah yes, "==". Otherwise, a "=" simply assigns a value to a variable, right?

Thanks for the revised script. I will give it a test asap! :-)

Regards,
grolschie
Received on Sat Apr 16 2005 - 17:26:46 MDT

This archive was generated by hypermail pre-2.1.9 : Sun May 01 2005 - 12:00:04 MDT