freebsd-ports/net/minidlna/files/minidlna.in
2013-11-27 15:24:16 +00:00

33 lines
778 B
Bash

#!/bin/sh
#
# $FreeBSD: head/net/minidlna/files/minidlna.in 323762 2013-07-26 23:25:40Z wg $
#
# PROVIDE: minidlna
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf[.local] to enable minidlna:
#
# minidlna_enable="YES"
. /etc/rc.subr
name=minidlna
rcvar=minidlna_enable
load_rc_config $name
minidlna_enable=${minidlna_enable-"NO"}
minidlna_uid=${minidlna_uid-"%%USER%%"}
command=%%PREFIX%%/sbin/minidlnad
pidfile="/var/run/minidlna/minidlna.pid"
command_args="-P $pidfile -u $minidlna_uid -f %%PREFIX%%/etc/minidlna.conf"
start_precmd="install -d -o $minidlna_uid ${pidfile%/*} /var/db/minidlna"
stop_postcmd="rm -f $pidfile"
extra_commands=rescan
rescan_cmd="$command -R -u $minidlna_uid -f %%PREFIX%%/etc/minidlna.conf"
run_rc_command $1