Merge pull request #145 from felixjogris/master

added FreeBSD RC script
This commit is contained in:
Andy 2018-01-22 04:22:36 +01:00 committed by GitHub
commit e0050641df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 29 additions and 0 deletions

29
contrib/ympd.freebsd Executable file
View File

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