POSTIN
/bin/sh
for schema in /usr/share/openldap/schema/ISPEnv2.schema; do
if ! grep -q "$schema" /etc/openldap/slapd.conf; then
/bin/sed -i -e "
/^include.*local.schema/{
iinclude\t $schema
}
" /etc/openldap/slapd.conf
fi
done
# enable dependant schemas
if [ "core,cosine" ]; then
/bin/sed -i -e '
/^#include.*\(core\|cosine\)\.schema/{
s/^#//
}' /etc/openldap/slapd.conf
fi
{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/ldap ] && . /etc/sysconfig/ldap
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/ldap ]; then
/sbin/service ldap restart 1>&2 || :;
fi
fi };
POSTUN
/bin/sh
if [ "$1" = "0" ]; then
for schema in /usr/share/openldap/schema/ISPEnv2.schema; do
if grep -q "$schema" /etc/openldap/slapd.conf; then
/bin/sed -i -e "
/^include.*$(echo "$schema" | /bin/sed -e 's,/,\\/,g')/d
# for symmetry it would be nice if we disable enabled schemas in post,
# but we really can not do that, it would break something else.
" /etc/openldap/slapd.conf
fi
done
{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/ldap ] && . /etc/sysconfig/ldap
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/ldap ]; then
/sbin/service ldap restart 1>&2 || :;
fi
fi };fi