Sophie

Sophie

distrib > PLD > ac > amd64 > by-pkgid > a11cb22c054cda49e7b3d720c72bebf9 > scriptlet

openldap-schema-courier-0.58-10.amd64.rpm

POSTIN

/bin/sh

for schema in /usr/share/openldap/schema/courier.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 [ "nis,cosine" ]; then 
	/bin/sed -i -e ' 
	/^#include.*\(nis\|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/courier.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