83eb2c3700
literal name_enable wherever possible, and ${name}_enable when it's not, to prepare for the demise of set_rcvar(). In cases where I had to hand-edit unusual instances also modify formatting slightly to be more uniform (and in some cases, correct). This includes adding some $FreeBSD$ tags, and most importantly moving rcvar= to right after name= so it's clear that one is derived from the other.
43 lines
1.2 KiB
Bash
43 lines
1.2 KiB
Bash
#!/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"
|