aboutsummaryrefslogtreecommitdiff
path: root/mail/dcc-dccd/files/dccifd.sh.in
blob: 669cc12727eed7c59fec98e9e288f8345536ca18 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh
#
# PROVIDE: dccifd
# REQUIRE: LOGIN
# BEFORE: mail
# KEYWORD: shutdown

#
# To enable dccifd add the following lines to /etc/rc.conf:
#
#dccifd_enable="YES"
#
# and in %%DCCHOME%%/dcc_conf change:
#
#DCCIFD_ENABLE=off
#
# to:
#
#DCCIFD_ENABLE=on
#
#
# See %%DCCHOME%%/dcc_conf to configure startup options
#

. %%RC_SUBR%%

name=dccifd
rcvar=`set_rcvar`

load_rc_config $name

# Set defaults
: ${dccifd_enable:="NO"}
: ${dccifd_home="%%DCCHOME%%"}
: ${dccifd_libexec="%%PREFIX%%/dcc/libexec"}
: ${dccifd_conf="$dccifd_home/dcc_conf"}

pidfile=${dccifd_pidfile:-"/var/run/dcc/dccifd.pid"}
procname="${dccifd_libexec}/dccifd"
required_dirs="${dccifd_home} ${dccifd_libexec}"
required_files="${dccifd_conf} ${dccifd_libexec}/rcDCC"

start_precmd="start_precmd"
start_cmd="start_dcc"

start_precmd()
{
X=`grep ^DCCIFD_ENABLE ${dccifd_conf}`
eval $X
if [ "$DCCIFD_ENABLE"  != "on" ]
then
	echo "Warning ${X} needs to be on in ${dccifd_conf} to start dccifd"
	return 1
fi
}

start_dcc()
{
	echo Starting dccifd.
	${dccifd_libexec}/rcDCC -m dccifd start
}

run_rc_command "$1"