File tree Expand file tree Collapse file tree 3 files changed +23
-8
lines changed
Expand file tree Collapse file tree 3 files changed +23
-8
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## 1.0.8
4+ - Fix an other startup bug ! whuhu
5+
36## 1.0.7
47 - Fix startup bug
58
Original file line number Diff line number Diff line change 11NAME = osixia/openldap
2- VERSION = 1.0.7
2+ VERSION = 1.0.8
33
44.PHONY : all build test tag_latest release
55
Original file line number Diff line number Diff line change @@ -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
115- else
116- # start openldap normaly
117- slapd -h " ldap://$HOSTNAME ldap://localhost ldapi:///" -u openldap -g openldap
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