aboutsummaryrefslogtreecommitdiff
path: root/net/openldap22/files/slapd.sh
blob: e8f6ed6b018dfe33b8fbd32a5fcd1ad348f323bc (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
#!/bin/sh
#
# $FreeBSD$

slapd_program=@@PREFIX@@/libexec/slapd

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

pidfile=/var/run/ldap/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`
	echo -n ' slapd'
	rm $pidfile
    else
	echo ' slapd: not running'
    fi
    ;;
*)
    echo "Usage: `basename $0` {start|stop}" >&2
    exit 64
    ;;
esac

exit 0