1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00
freebsd-ports/audio/ympd/files/ympd.in
2018-07-12 15:44:24 +00:00

40 lines
700 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: ympd
# REQUIRE: DAEMON NETWORKING musicpd
# KEYWORD: shutdown
# Add the following line to /etc/rc.conf to enable ympd:
#
# ympd_enable (bool): set to NO by default.
# Set it to YES to enable ympd.
#
# ympd_flags (string): optional flags to pass through to daemon
. /etc/rc.subr
name=ympd
rcvar=ympd_enable
desc="A lightweight web UI for audio/musicpd"
# defaults
: ${ympd_enable:=NO}
: ${ympd_flags:=""}
load_rc_config ${name}
start_cmd="ympd_start"
command="%%PREFIX%%/bin/${name}"
pidfile="/var/run/${name}.pid"
ympd_start () {
echo "Starting ympd."
/usr/sbin/daemon -t ${name} -f -p ${pidfile} ${command} ${ympd_flags}
}
run_rc_command "$1"