aboutsummaryrefslogtreecommitdiff
path: root/net/minidlna/files/minidlna.in
diff options
context:
space:
mode:
Diffstat (limited to 'net/minidlna/files/minidlna.in')
-rw-r--r--net/minidlna/files/minidlna.in34
1 files changed, 34 insertions, 0 deletions
diff --git a/net/minidlna/files/minidlna.in b/net/minidlna/files/minidlna.in
new file mode 100644
index 000000000000..b2803349c32c
--- /dev/null
+++ b/net/minidlna/files/minidlna.in
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# 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
+command=%%PREFIX%%/sbin/minidlna
+
+load_rc_config $name
+
+minidlna_enable=${minidlna_enable-"NO"}
+minidlna_uid=${minidlna_uid-"%%USER%%"}
+
+pidfile="/var/db/minidlna/minidlna.pid"
+
+start_precmd="rm -f $pidfile"
+stop_postcmd=$start_precmd
+
+command_args="-P $pidfile -u $minidlna_uid"
+extra_commands=rescan
+rescan_cmd="$command -R -u $minidlna_uid"
+required_dirs="/var/db/minidlna"
+
+run_rc_command $1