Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 016c90a34df440e93d60cb4b78d997b1 > scriptlet

bind-sdb-9.3.6-25.P1.el5_11.11.x86_64.rpm

PREUN

/bin/sh
if [ "$1" -eq 0 ] && [ -x /usr/sbin/named_sdb ] && [ -f /etc/openldap/slapd.conf ]; then
   if /bin/egrep -q '^include.*\dnszone.schema' /etc/openldap/slapd.conf; then
      tf=`/bin/mktemp /tmp/XXXXXX`
      /bin/egrep -v '^include.*dnszone\.schema' /etc/openldap/slapd.conf > $tf
      /bin/chmod --reference=/etc/openldap/slapd.conf $tf
      /bin/chown --reference=/etc/openldap/slapd.conf $tf
      /bin/mv -f $tf /etc/openldap/slapd.conf;
      rm -f $tf >/dev/null 2>&1
      [ -e /selinux/enforce ] && [ -x /sbin/restorecon ] && /sbin/restorecon /etc/openldap/slapd.conf >/dev/null 2>&1 || :;
      [ -x /etc/init.d/ldap ] && /etc/init.d/ldap condrestart >/dev/null 2>&1 || :;
   fi;
fi;
:;

POSTIN

/bin/sh
if [ "$1" -ge 1 ]; then
   # check that dnszone.schema is installed in OpenLDAP's slapd.conf
   if [ -x /usr/sbin/named_sdb ] && [ -f /etc/openldap/slapd.conf ]; then
   # include the LDAP dnszone.schema in slapd.conf:
      if ! /bin/egrep -q '^include.*\dnszone.schema' /etc/openldap/slapd.conf; then
         tf=`/bin/mktemp /tmp/XXXXXX`
         let n=`/bin/grep -n '^include.*\.schema' /etc/openldap/slapd.conf | /usr/bin/tail -1 | /bin/sed 's/:.*//'`
         if [ "$n" -gt 0 ]; then
   	    /bin/cp -fp /etc/openldap/slapd.conf /etc/openldap/slapd.conf.rpmsave;
	    /usr/bin/head -$n /etc/openldap/slapd.conf > $tf
            echo 'include         /etc/openldap/schema/dnszone.schema' >> $tf
            let n='n+1'
            /usr/bin/tail -n +$n /etc/openldap/slapd.conf >> $tf
            /bin/mv -f $tf /etc/openldap/slapd.conf;
            /bin/chmod --reference=/etc/openldap/slapd.conf.rpmsave /etc/openldap/slapd.conf
	    /bin/chown --reference=/etc/openldap/slapd.conf.rpmsave /etc/openldap/slapd.conf
            [ -e /selinux/enforce ] && [ -x /sbin/restorecon ] && /sbin/restorecon /etc/openldap/slapd.conf >/dev/null 2>&1 || :;
            [ -x /etc/init.d/ldap ] && /etc/init.d/ldap condrestart >/dev/null 2>&1
         fi
         rm -f $tf >/dev/null 2>&1 || :;
      fi;
   fi;
fi;
:;