summaryrefslogtreecommitdiff
path: root/audio/ympd/files/ympd.in
blob: 557c0a8638f3b927c4475ee172f9fecc893721c2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#

# 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"