aboutsummaryrefslogtreecommitdiffstats
path: root/net/openldap/files/slapd.sh
blob: 1704074b7968f414c0a0ed7e8ff0f3322b3cd140 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
#
# $FreeBSD$

slapd=@@PREFIX@@/libexec/slapd
pidfile=/var/run/slapd.pid

case "$1" in
start)
    if [ -x $slapd ]; then
    echo -n ' slapd'
    $slapd
    fi
    ;;
stop)
    if [ -f $pidfile ]; then
    kill `cat $pidfile`
    telnet localhost ldap </dev/null >/dev/null 2>&1
    echo -n ' slapd'
    rm $pidfile
    else
    echo ' slapd: not running'
    fi
    ;;
*)
    echo "Usage: `basename $0` {start|stop}" >&2
    exit 64
    ;;
esac

exit 0