[D-community-commits] r245 - trunk/fai-config-dir/scripts/LDAPSERVER

holger at alioth.debian.org holger at alioth.debian.org
Mon Mar 10 13:26:11 UTC 2008


Author: holger
Date: 2008-03-10 13:26:10 +0000 (Mon, 10 Mar 2008)
New Revision: 245

Modified:
   trunk/fai-config-dir/scripts/LDAPSERVER/10-slapd
Log:
code cleanup

Modified: trunk/fai-config-dir/scripts/LDAPSERVER/10-slapd
===================================================================
--- trunk/fai-config-dir/scripts/LDAPSERVER/10-slapd	2008-03-09 12:18:14 UTC (rev 244)
+++ trunk/fai-config-dir/scripts/LDAPSERVER/10-slapd	2008-03-10 13:26:10 UTC (rev 245)
@@ -6,9 +6,6 @@
 fcopy -r -M /etc/ldap/
 fcopy -r -M /etc/phpldapadmin
 
-# tmp rm
-rm //etc/ldap/schema/dc.schema
-
 #
 # initialize ldap once
 #
@@ -17,11 +14,11 @@
 # Ugly hack to remove the default database
 #if ! $ROOTCMD ldapsearch -h localhost -x -b "ou=People,dc=debian-community,dc=org" &>/dev/null; then
     $ROOTCMD /etc/init.d/slapd stop
+    sleep 2
     $ROOTCMD rm -rf /var/lib/ldap/*
-    $ROOTCMD /etc/init.d/slapd start                                    
-    $ROOTCMD /etc/init.d/slapd stop 
     echo -n "Creating initial LDAP directory..."
-    cat <<-EOF | $ROOTCMD slapadd 
+    TMPFILE=`mktemp`
+    cat > $TMPFILE <<- EOF 
 dn: dc=debian-community,dc=org
 objectClass: top
 objectClass: dcObject
@@ -41,8 +38,10 @@
 objectClass: organizationalUnit
 objectClass: top
 EOF
-    $ROOTCMD sudo -u openldap slapindex -v
-    $ROOTCMD  chown openldap:openldap /var/lib/ldap/*
-    $ROOTCMD /etc/init.d/slapd start
+   cat $TMPFILE | $ROOTCMD slapadd 
+   rm $TMPFILE
+   $ROOTCMD sudo -u openldap slapindex -v
+   $ROOTCMD  chown openldap:openldap /var/lib/ldap/*
+   $ROOTCMD /etc/init.d/slapd start
 #fi    
 




More information about the D-community-commits mailing list