forked from dinkel/docker-openldap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b28b793
commit 2b7ebba
Showing
5 changed files
with
80 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
set -e | ||
first_run=true | ||
|
||
if [[ -f "/etc/ldap/ldap_populated" ]]; then | ||
first_run=false | ||
fi | ||
|
||
# Wait until 'LDAP started and listens on port 389'. | ||
while [ -z "`netstat -tln | grep 389`" ]; do | ||
echo 'Waiting for LDAP to start ...' | ||
sleep 1 | ||
done | ||
echo 'LDAP started.' | ||
|
||
dc_string="" | ||
IFS="."; declare -a dc_parts=($SLAPD_DOMAIN); unset IFS | ||
|
||
for dc_part in "${dc_parts[@]}"; do | ||
dc_string="$dc_string,dc=$dc_part" | ||
done | ||
|
||
echo "DC string: $dc_string" | ||
|
||
if [[ "$first_run" == "true" ]]; then | ||
echo "Loading prepopulate data." | ||
if [[ -d "/etc/ldap/prepopulate/data/" ]]; then | ||
for file in `ls /etc/ldap/prepopulate/data/*.ldif`; do | ||
ldapadd -x -D cn=admin$dc_string -w $SLAPD_PASSWORD -f "$file" | ||
done | ||
fi | ||
touch /etc/ldap/ldap_populated | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[supervisord] | ||
nodaemon=true | ||
logfile_backups=1 | ||
|
||
[program:ldap] | ||
command=./entrypoint.sh | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 | ||
|
||
[program:populate] | ||
command=./populate.sh | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 | ||
|