blob: 372c0c32d694c7d6f8ac1b5feab0301e55515779 (
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
48
49
50
51
52
53
54
|
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: gerbera
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable gerbera:
# gerbera_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable gerbera.
# gerbera_flags (str): Custom additional arguments to be passed
# to gerbera (default empty).
# gerbera_conf_dir (str): Directory where ${name} configuration
# data is stored.
. /etc/rc.subr
name="gerbera"
rcvar=gerbera_enable
load_rc_config ${name}
: ${gerbera_enable:="NO"}
: ${gerbera_user:="%%USER%%"}
: ${gerbera_group:="%%GROUP%%"}
: ${gerbera_conf_dir="%%PREFIX%%/etc"}
start_precmd=gerbera_precmd
stop_postcmd=gerbera_stop_postcmd
procname="%%PREFIX%%/bin/${name}"
pidfile="/var/run/gerbera/gerbera.pid"
required_files="${gerbera_conf_dir}/gerbera-config.xml"
command="/usr/sbin/daemon"
command_args="-f -t ${name} -p ${pidfile} ${procname} -c ${required_files} -l /var/log/gerbera/gerbera.log ${gerbera_args}"
gerbera_precmd()
{
local rundir=${pidfile%/*}
if [ ! -d $rundir ] ; then
install -d -m 0755 -o %%USER%% -g %%GROUP%% $rundir
fi
}
gerbera_stop_postcmd()
{
rm -f "$rundir"
}
run_rc_command "$1"
|