updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / mpd-pulse / mpd
blobbe7a5e0fe6abc1e48b57f3c2addda458da8125d3
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 case "$1" in
7 start)
8 stat_busy "Starting Music Player Daemon"
9 [ ! -d /var/run/mpd ] && install -d -g 45 -o 45 /var/run/mpd
10 /usr/bin/mpd /etc/mpd.conf &> /dev/null
11 if [ $? -gt 0 ]; then
12 stat_fail
13 else
14 add_daemon mpd
15 stat_done
18 stop)
19 stat_busy "Stopping Music Player Daemon"
20 /usr/bin/mpd --kill /etc/mpd.conf &> /dev/null
21 if [ $? -gt 0 ]; then
22 stat_fail
23 else
24 rm_daemon mpd
25 stat_done
28 create-db)
29 stat_busy "Creating mpd's database ..."
30 logpath="/var/log/mpd/mpd.db-creation"
31 /usr/bin/mpd --create-db /etc/mpd.conf > $logpath \
32 && stat_busy "Output written to $logpath"
33 stat_done
35 restart)
36 $0 stop
37 sleep 1
38 $0 start
41 echo "usage: $0 {start|stop|restart|create-db}"
42 esac
43 exit 0