summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2016-06-08 10:01:38 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2016-06-08 10:01:38 (GMT)
commitcd56fc1f698994fbbb9e5ce28f25ef2d6b4c5763 (patch)
treec8595bbaf815ca0f0ecf3466567c584d5820c5f9
parent74fdfafe8726ebbda3381850f94f440db0a5751e (diff)
downloadcfdt-cd56fc1f698994fbbb9e5ce28f25ef2d6b4c5763.zip
cfdt-cd56fc1f698994fbbb9e5ce28f25ef2d6b4c5763.tar.gz
cfdt-cd56fc1f698994fbbb9e5ce28f25ef2d6b4c5763.tar.bz2
start.sh: utilise ldapadd pour charger les données, sinon les overlays ne s'appliquent pas
-rwxr-xr-xpoc-1/start.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/poc-1/start.sh b/poc-1/start.sh
index c878d2f..ce37711 100755
--- a/poc-1/start.sh
+++ b/poc-1/start.sh
@@ -16,7 +16,9 @@ function try {
CONFIG=`pwd`/data/slapd.d
DB=`pwd`/data/db
+NEW=0
if [ ! -d data ]; then
+ NEW=1
mkdir -p data data/db data/slapd.d
cat base.ldif >>data/config.ldif
echo >>data/config.ldif
@@ -26,7 +28,6 @@ if [ ! -d data ]; then
done;
m4 -DPATH=$DB db.ldif >>data/config.ldif
try slapadd -n0 -F $CONFIG -l data/config.ldif
- try slapadd -n1 -F $CONFIG -l <(m4 data.ldif)
fi
slapd -h "ldapi://data%2Fsocket/ ldap://localhost:1389/" -F $CONFIG -d768 >>data/log 2>&1 &
@@ -48,3 +49,7 @@ echo ldapsearch -H ldapi://data%2Fsocket -Y EXTERNAL -b dc=cfdt,dc=fr
echo
echo ldapsearch -H ldap://localhost:1389 -D dc=cfdt,dc=fr -w admin -b dc=cfdt,dc=fr
echo
+if [[ "$NEW" = "1" ]]; then
+ sleep 1
+ try ldapadd -H ldapi://data%2Fsocket -Y EXTERNAL -f <(m4 data.ldif)
+fi