summaryrefslogtreecommitdiff
path: root/www/web2ldap/files/web2ldap.in
blob: 6c2f06237475c9eb51300a5d3a247c28d3258352 (plain)
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
#!/bin/sh
# $FreeBSD$

# PROVIDE: web2ldap
# REQUIRE: DAEMON NETWORKING
# BEFORE: LOGIN
# KEYWORD: shutdown

# Add the following lines to /etc/rc.conf to enable web2ldap:
# web2ldap_enable="NO"
#
# web2ldap_enable (bool):	Set to YES to enable web2ldap
#				Default: NO
# web2ldap_user (str):		web2ldap daemon user
#				Default: nobody
# web2ldap_group (str):		web2ldap daemon group
#				Default: nogroup
. /etc/rc.subr

name="web2ldap"
rcvar=web2ldap_enable

: ${web2ldap_enable:="NO"}
: ${web2ldap_user:="nobody"}
: ${web2ldap_group:="nogroup"}

# daemon
pidfile="/var/run/${name}.pid"
command=/usr/sbin/daemon
procname="daemon"
command_args=" -c -f -P ${pidfile} %%PREFIX%%/bin/${name}"
start_precmd="web2ldap_precmd"

web2ldap_precmd()
{
    install -o ${web2ldap_user} /dev/null ${pidfile}
}

load_rc_config $name
run_rc_command "$1"