summaryrefslogtreecommitdiff
path: root/net/mpd5/files/mpd5.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'net/mpd5/files/mpd5.sh.in')
-rw-r--r--net/mpd5/files/mpd5.sh.in46
1 files changed, 46 insertions, 0 deletions
diff --git a/net/mpd5/files/mpd5.sh.in b/net/mpd5/files/mpd5.sh.in
new file mode 100644
index 000000000000..77caa812689a
--- /dev/null
+++ b/net/mpd5/files/mpd5.sh.in
@@ -0,0 +1,46 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: mpd
+# REQUIRE: SERVERS
+# BEFORE: DAEMON
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable mpd5:
+# mpd_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable mpd5.
+# mpd_flags (string): Set to "-b" by default.
+# Extra flags passed to start command.
+#
+# See mpd(8) for flags.
+#
+
+. %%RC_SUBR%%
+
+name="mpd5"
+rcvar=`set_rcvar mpd`
+
+load_rc_config ${name}
+
+: ${mpd_enable="NO"}
+: ${mpd_flags="-b"}
+
+pidfile="/var/run/${name}.pid"
+command="%%PREFIX%%/sbin/${name}"
+required_files="%%PREFIX%%/etc/${name}/mpd.conf"
+
+case "${mpd_flags}" in
+*-p\ *)
+ echo "ERROR: \$mpd_flags includes -p option." \
+ "PID file is already set to $pidfile."
+ exit 1
+ ;;
+*)
+ command_args="-p ${pidfile} ${mpd_flags}"
+ ;;
+esac
+
+run_rc_command "$1"