aboutsummaryrefslogtreecommitdiffstats
path: root/net/openldap22/files/slapd.sh
blob: 0e3601b07e5cf9438b1e4d4d4f66363d30f55bf7 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
#
# $FreeBSD$

slapd_program=@@PREFIX@@/libexec/slapd

# Uncomment one of the following:
#
# IPv4 Only
#slapd_args='-h ldap://0.0.0.0'
#
# IPv6 and IPv4
#slapd_ags='-h "ldap://[::] ldap://0.0.0.0"'
#
# IPv6 Only
#slapd_args='-h ldap://[::]'
#
#
slapd_args=

pidfile=/var/run/slapd.pid

case "$1" in
start)
    if [ -x $slapd ]; then
    echo -n ' slapd'
    eval ${slapd_program} ${slapd_args}

    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