mirror of
https://github.com/SuperBFG7/ympd
synced 2024-11-28 23:49:55 +00:00
80834b989f
- removed /usr/sbin/daemon's option "-t" (first appeared in FreeBSD 11, leading to an error in previous versions; since the [t]itle defaults to the daemonized invocation anyways, this shouldn't make a difference for FreeBSD 11+) - removed /usr/sbin/daemon's option "-u" and the respective variable in the script (ympd has to be started as root to be able to bind to port 80) - allow for additional arguments via ympd_flags="" in rc.conf (which would again allow to drop privileges after binding to the port)
29 lines
489 B
Bash
Executable File
29 lines
489 B
Bash
Executable File
#!/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/${name}"
|
|
pidfile="/var/run/${name}.pid"
|
|
start_cmd="ympd_start"
|
|
|
|
load_rc_config "${name}"
|
|
: ${ympd_enable:="NO"}
|
|
|
|
ympd_start()
|
|
{
|
|
check_startmsgs && echo "Starting ${name}."
|
|
/usr/sbin/daemon -f -p "${pidfile}" "${command}" "${rc_flags}"
|
|
}
|
|
|
|
run_rc_command "$1"
|