blob: c6772ccfb593fb59893191857e089ec11691ccd5 (
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
37
38
39
40
41
42
43
44
45
|
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: mpd
# REQUIRE: NETWORKING
# BEFORE: SERVERS
#
# Add the following lines to /etc/rc.conf to enable mpd4:
# mpd_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable mpd4.
# mpd_flags (string): Set to "-b" by default.
# Extra flags passed to start command.
#
# See mpd(8) for flags.
#
. %%RC_SUBR%%
name="mpd4"
rcvar=`set_rcvar mpd`
load_rc_config ${name}
: ${mpd_enable="NO"}
: ${mpd_flags="-b"}
pidfile="/var/run/${name}.pid"
command="%%PREFIX%%/sbin/${name}"
required_files="%%PREFIX%%/etc/${name}/mpd.conf %%PREFIX%%/etc/${name}/mpd.links"
case "${mpd_flags}" in
*-p\ *)
echo "ERROR: \$mpd_flags includes -p option." \
"PID file is already set to $pidfile."
exit 1
;;
*)
command_args="${mpd_flags} -p ${pidfile}"
;;
esac
run_rc_command "$1"
|