1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-24 09:25:01 +00:00
freebsd-ports/audio/musicpd/files/musicpd.in
2021-04-06 16:31:13 +02:00

37 lines
661 B
Bash

#!/bin/sh
# PROVIDE: musicpd
# REQUIRE: mixer LOGIN avahi_daemon oss
# KEYWORD: shutdown
# Add the following line to /etc/rc.conf to enable mpd:
#
# musicpd_enable=YES
. /etc/rc.subr
name=musicpd
rcvar=musicpd_enable
desc="Music Player Daemon"
load_rc_config $name
: ${musicpd_enable:=NO}
command=%%PREFIX%%/bin/musicpd
command_args=%%PREFIX%%/etc/musicpd.conf
required_files=%%PREFIX%%/etc/musicpd.conf
start_precmd=${name}_getpidfile
stop_precmd=${name}_getpidfile
musicpd_getpidfile()
{
if get_pidfile_from_conf pid_file %%PREFIX%%/etc/musicpd.conf ; then
pidfile="$_pidfile_from_conf"
else
pidfile="/var/mpd/.mpd/pid"
fi
}
run_rc_command $1