#!/bin/bash # Modul autentikasi untuk squid akan membaca daftar user dan password ke LDAP # created by Henry Saptono , Depok 30 Mar 2007 # Cara penggunaan di squid sbb: # auth_param basic program /path/to/squid_ldap_maut.sh ou=Users,dc=overflow,dc=web.id 127.0.0.1 if [ -z "$1" ]; then echo "Gagal: gunakan : $0 " exit 1 fi; while [ 1 ]; do read x user=`echo $x| awk '{print $1}'` password=`echo $x| awk '{print $2}'` cekuser=`ldapsearch -x -b "$1" -D "uid=$user,$1" -w $password -h $2 "uid=$user" 2> /dev/null | grep -w "Success"` if [ -n "$cekuser" ] ; then echo "OK" else echo "ERR" fi done; exit 0