File tree Expand file tree Collapse file tree 2 files changed +21
-9
lines changed
Expand file tree Collapse file tree 2 files changed +21
-9
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
33## 1.0.8
4- - Fix startup bug
4+ - Fix an other startup bug ! whuhu
55
66## 1.0.7
77 - Fix startup bug
Original file line number Diff line number Diff line change 1- #! /bin/bash -ex
1+ #! /bin/bash -e
22
33FIRST_START_DONE=" /etc/docker-openldap-first-start-done"
44WAS_STARTED_WITH_TLS=" /etc/ldap/slapd.d/docker-openldap-was-started-with-tls"
@@ -103,21 +103,33 @@ EOF
103103 fi
104104
105105 # start OpenLDAP
106- echo " Starting openldap..."
106+
107+
108+ function startOpenLDAP(){
109+
110+ if [ -n " $PREVIOUS_HOSTNAME " ]; then
111+ PREVIOUS_HOSTNAME=" ldap://$PREVIOUS_HOSTNAME "
112+ fi
113+
114+ # start openldap normaly
115+ echo " Starting openldap..."
116+ slapd -h " ldap://$HOSTNAME $PREVIOUS_HOSTNAME ldap://localhost ldapi:///" -u openldap -g openldap
117+ echo " [ok]"
118+ }
107119
108120 # start OpenLDAP with previous replication configuration
109121 if [ -e " $WAS_STARTED_WITH_REPLICATION " ]; then
110122
111123 . $WAS_STARTED_WITH_REPLICATION
112- echo " 127.0.0.2 $PREVIOUS_HOSTNAME " >> /etc/hosts
113124
114- slapd -h " ldap://$HOSTNAME ldap://$PREVIOUS_HOSTNAME ldap://localhost ldapi:///" -u openldap -g openldap -d $LDAP_LOG_LEVEL
115- else
116- # start openldap normaly
117- slapd -h " ldap://$HOSTNAME ldap://localhost ldapi:///" -u openldap -g openldap -d $LDAP_LOG_LEVEL
125+ if [ " $PREVIOUS_HOSTNAME " != " $HOSTNAME " ]; then
126+ echo " 127.0.0.2 $PREVIOUS_HOSTNAME " >> /etc/hosts
127+ else
128+ PREVIOUS_HOSTNAME=" "
129+ fi
118130 fi
119131
120- echo " [ok] "
132+ startOpenLDAP
121133
122134 # set bootstrap config part 2
123135 if $BOOTSTRAP ; then
You can’t perform that action at this time.
0 commit comments