aboutsummaryrefslogtreecommitdiff
path: root/net/mediatomb/files/mediatomb.in
blob: 31476a2f41cb8ae7b81d1cc95dfefb431325f6dc (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
#!/bin/sh
# $FreeBSD$

# PROVIDE: mediatomb
# REQUIRE: DEAMON
# KEYWORD: shutdown

# Define these mediatomb_* variables in one of these files:
#       /etc/rc.conf
#       /etc/rc.conf.local
#       /etc/rc.conf.d/mediatomb
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#

. /etc/rc.subr

mediatomb_enable=${mediatomb_enable-"NO"}
# mediatomb_flags="<set as needed>"
# mediatomb_interface="<set as needed>"
mediatomb_mtuser=${mediatomb_mtuser-"%%MEDIATOMB_USER%%"}
mediatomb_mtgroup=${mediatomb_mtgroup-"%%MEDIATOMB_GROUP%%"}
mediatomb_config=${mediatomb_config-"%%PREFIX%%/etc/mediatomb/config.xml"}
mediatomb_logfile=${mediatomb_logfile-"%%MEDIATOMB_DIR%%/mediatomb.log"}
mediatomb_pidfile=${mediatomb_pidfile-"%%MEDIATOMB_DIR%%/mediatomb.pid"}

name="mediatomb"
rcvar=mediatomb_enable

load_rc_config $name

if [ "xx" != "x${mediatomb_interface}x" ]; then
    mediatomb_interface_command="-e ${mediatomb_interface}"
else
    mediatomb_interface_command=""
fi

command="%%PREFIX%%/bin/mediatomb"
command_args="-d -c ${mediatomb_config} -l ${mediatomb_logfile} -u ${mediatomb_mtuser} -g ${mediatomb_mtgroup} -P ${mediatomb_pidfile} ${mediatomb_interface_command}"

pidfile="${mediatomb_pidfile}"

run_rc_command "$1"