#! /bin/sh
#
# Written by Miquel van Smoorenburg <miquels@drinkel.ow.org>.
# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Modified for Debian by Christoph Lameter <clameter@debian.org>

PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/slapd

test -f $DAEMON || exit 0

case "$1" in
  start)
    echo -n "Starting ldap server: slapd"
    start-stop-daemon --start --quiet --pidfile /var/run/slapd.pid \
		--exec $DAEMON
    echo "."
    ;;
  stop)
    echo -n "Stopping ldap server: slapd"
    start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/slapd.pid \
		--exec $DAEMON
    echo "."
    ;;
  *)
    echo "Usage: /etc/init.d/ldap {start|stop}"
    exit 1
    ;;
esac

exit 0
