From 40906e2beef24661cc9bb01c5d2aed6a296bece1 Mon Sep 17 00:00:00 2001 From: "Felix J. Ogris" Date: Mon, 6 Feb 2017 20:19:09 +0100 Subject: [PATCH] added FreeBSD RC script --- contrib/ympd.freebsd | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 contrib/ympd.freebsd diff --git a/contrib/ympd.freebsd b/contrib/ympd.freebsd new file mode 100755 index 0000000..4dcbedd --- /dev/null +++ b/contrib/ympd.freebsd @@ -0,0 +1,29 @@ +#!/bin/sh + +# PROVIDE: ympd +# REQUIRE: DAEMON musicpd +# KEYWORD: shutdown + +# Add the following line to /etc/rc.conf to enable ympd: +# +# ympd_enable="YES" + +. /etc/rc.subr + +name="ympd" +rcvar="${name}_enable" +command="/usr/local/bin/ympd" +pidfile="/var/run/${name}.pid" +start_cmd="ympd_start" + +load_rc_config "$name" +: ${ympd_enable:="NO"} +: ${ympd_user:="nobody"} + +ympd_start() +{ + check_startmsgs && echo "Starting ${name}." + /usr/sbin/daemon -f -p "${pidfile}" -t "${name}" -u "${ympd_user}" "${command}" +} + +run_rc_command "$1" -- 2.20.1