[D-community-commits] r187 - trunk/fai-config-dir/scripts/LDAPSERVER
nd-guest at alioth.debian.org
nd-guest at alioth.debian.org
Mon Jan 7 00:06:26 UTC 2008
Author: nd-guest
Date: 2008-01-07 00:06:26 +0000 (Mon, 07 Jan 2008)
New Revision: 187
Modified:
trunk/fai-config-dir/scripts/LDAPSERVER/10-slapd
Log:
slapd creates an empty password for the admin user in noninteractive mode.
Remove the database before setting up our own.
Modified: trunk/fai-config-dir/scripts/LDAPSERVER/10-slapd
===================================================================
--- trunk/fai-config-dir/scripts/LDAPSERVER/10-slapd 2008-01-06 22:46:53 UTC (rev 186)
+++ trunk/fai-config-dir/scripts/LDAPSERVER/10-slapd 2008-01-07 00:06:26 UTC (rev 187)
@@ -4,11 +4,18 @@
# GPL2 licenced
fcopy -r -M /etc/ldap
+fcopy -M /etc/ldap/slapd.conf
fcopy -r -M /etc/phpldapadmin
-/etc/init.d/slapd stop
-echo -n "Creating initial LDAP directory..."
-cat <<-EOF | slapadd
+# 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
+ $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
dn: dc=debian-community,dc=org
objectClass: top
objectClass: dcObject
@@ -28,4 +35,5 @@
objectClass: organizationalUnit
objectClass: top
EOF
-/etc/init.d/slapd start
+ $ROOTCMD /etc/init.d/slapd start
+fi
More information about the D-community-commits
mailing list