blob: 5495a951f63fb75071d418b51be44042a07f8d4b (
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
41
42
43
44
45
46
47
|
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: openct
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable openct:
# openct_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable OpenCT.
#
. /etc/rc.subr
name="openct"
rcvar=openct_enable
load_rc_config $name
: ${openct_enable="NO"}
openct_rundir="/var/run/openct"
command="%%PREFIX%%/sbin/openct-control"
command_args="init"
start_precmd="${name}_prestart"
stop_cmd="${name}_stop"
required_files="%%PREFIX%%/etc/openct.conf"
openct_prestart()
{
if [ ! -d "${openct_rundir}/." ]; then
/bin/mkdir ${openct_rundir}
fi
}
openct_stop()
{
if [ -f "${openct_rundir}/status" ]; then
${command} shutdown > /dev/null
fi
}
run_rc_command "$1"
|