aboutsummaryrefslogtreecommitdiff
path: root/service/mpd
blob: 4f0f467dcc83330a72a9d2c03e591564ffd6940b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/home/cynerd/.local/sbin/user-service.sh
# vim: ft=sh

description="Music player daemon"
pidfile=".config/mpd/pid"

MPD_PID=~/.config/mpd/pid
if [ ! -e $MPD_PID ] || ! kill -0 $(cat $MPD_PID); then
	mpd ~/.config/mpd/mpd.conf
fi

status() {
	[ -f $pidfile ] || return 1
	kill -0 "$(cat $pidfile)" || return 1
}

start() {
	mpd ~/.config/mpd/mpd.conf
}

stop() {
	mpd --kill ~/.config/mpd/mpd.conf
}