ldap/init
2017-05-25 23:29:15 +10:00

22 lines
350 B
Bash
Executable File

#!/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