#!/bin/sh
hasTLS_REQCERT=`grep -n 'TLS_REQCERT' /etc/openldap/ldap.conf | grep -v ';' | grep -v '#' | head -1 | cut -d ':' -f 1`
if [ -z "$hasTLS_REQCERT" ];then
    echo "TLS_REQCERT allow" >> /etc/openldap/ldap.conf
    if [ -f /bin/systemctl ];then
        /bin/systemctl restart httpd.service
    elif [ -f /etc/init.d/httpd ] ;then   
        /etc/init.d/httpd restart
    else
        service httpd restart
    fi
fi
