freebsd-ports/audio/spotifyd/files/spotifyd.in
Steve Wills 5532bb619d audio/spotifyd: fix rc script args
PR:		241680
Approved by:	tobik (maintainer)
2019-11-08 23:52:37 +00:00

40 lines
1.1 KiB
Bash

#!/bin/sh
# PROVIDE: spotifyd
# REQUIRE: DAEMON NETWORKING
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local, /etc/rc.conf or
# /etc/rc.conf.d/spotifyd to enable this service:
#
# spotifyd_enable (bool): Set to NO by default.
# Set it to "YES" to enable spotifyd.
# spotifyd_config (str): Set to %%PREFIX%%/etc/spotifyd.conf by default.
# Path to configuration file.
# spotifyd_user (str): Set to "nobody" by default.
# User to run spotifyd
. /etc/rc.subr
name=spotifyd
rcvar=spotifyd_enable
start_precmd="${name}_precmd"
load_rc_config $name
: ${spotifyd_enable:="NO"}
: ${spotifyd_config:="%%PREFIX%%/etc/spotifyd.conf"}
: ${spotifyd_user:="nobody"}
pidfile="/var/run/${name}/${name}.pid"
procname="%%PREFIX%%/bin/${name}"
command="/usr/sbin/daemon"
command_args="-S -m 3 -s info -l daemon -p ${pidfile} ${procname} --no-daemon --config-path ${spotifyd_config} ${spotifyd_args}"
spotifyd_precmd()
{
/usr/bin/install -d -m 0755 -o ${spotifyd_user} /var/run/${name}
}
run_rc_command "$1"