Script:
BUSCA=`ldapsearch -x -h $1 2> error`
if [ ${#BUSCA} = 0 ];
then
echo 0
else
echo 1
fi
This return 1 when LDAP is online and 0 when LDAP is offline... But when I try to load the module it doesn't initialize. Why?
I have a similar for checking DNS Server and it works just fine:
BUSCA=`nslookup $1 | grep $2`
if [ ${#BUSCA} = 0 ];
then
echo 0
else
echo 1
fi