ldap/init

22 lines
350 B
Plaintext
Raw Normal View History

2017-05-25 13:29:15 +00:00
#!/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