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
Received on Sat Apr 16 2005 - 16:59:16 MDT
This archive was generated by hypermail pre-2.1.9 : Sun May 01 2005 - 12:00:04 MDT