smeserver-ldap/root/sbin/e-smith/systemd/ldap-finish

22 lines
357 B
Bash

#! /bin/sh
exec 2>&1
LDIF=$(readlink -n /etc/openldap/ldif)
TMP=$LDIF.$$
if /usr/sbin/slapcat -l $TMP
then
mv -f $TMP $LDIF
else
echo slapcat dump of ldif failed - shutting down ldap service >&2
echo probable corruption of ldap backend files >&2
# Don't bother to keep a zero length dump file
if test ! -s $TMP
then
rm -f $TMP
fi
fi