ansible-roles/smartgears/r_connector/files/check_ldap_users

24 lines
515 B
Bash

#!/bin/bash
NSCD_SERVICE="nscd"
NSLCD_SERVICE="nslcd"
SERVICE_CMD="/usr/sbin/service"
RETVAL=
CHECK_USER=$( id pasquale.pagano )
RETVAL=$?
restart_ns_services() {
$SERVICE_CMD $NSCD_SERVICE restart > /dev/null 2>&1
$SERVICE_CMD $NSLCD_SERVICE restart > /dev/null 2>&1
logger "check_ldap_users: Restarted the $NSCD_SERVICE and $NSLCD_SERVICE services."
}
if [ $RETVAL -ne 0 ] ; then
logger "check_ldap_users: The ldap connection is broken"
restart_ns_services
fi
exit 0