22 lines
350 B
Plaintext
22 lines
350 B
Plaintext
|
#!/bin/bash
|
||
|
set -e
|
||
|
|
||
|
NAME="OPENLDAP"
|
||
|
|
||
|
function stop {
|
||
|
echo "Stopping ${NAME}"
|
||
|
kill $(cat /var/run/openldap/slapd.pid)
|
||
|
}
|
||
|
|
||
|
trap 'stop' SIGTERM
|
||
|
|
||
|
if [ "$1" == "start" ]; then
|
||
|
SLAPD_URLS="ldapi:/// ldap:/// ldaps:///"
|
||
|
SLAPD_OPTIONS="-d 256"
|
||
|
|
||
|
[ -x /usr/sbin/slapd ] && /usr/sbin/slapd -u ldap -h "${SLAPD_URLS}" $SLAPD_OPTIONS &
|
||
|
wait
|
||
|
else
|
||
|
exec $@
|
||
|
fi
|