summaryrefslogtreecommitdiff
path: root/packages/musicpd/mpd/mpd.init
blob: 98a75d0af7cc2bc3ce9871421e7eb3ace9f856b5 (plain)
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
#! /bin/sh
#
# > update-rc.d mpd defaults 20
#

test -f /usr/bin/mpd || exit 0
test -f /etc/mpd.conf || exit 0

case "$1" in
  start)
    echo -n "Starting music player daemon: mpd"
    start-stop-daemon --start --quiet --exec /usr/bin/mpd
    echo "."
    ;;
  stop)
    echo -n "Stopping music player daemon: mpd"
    start-stop-daemon --stop --quiet --exec /usr/bin/mpd
    echo "."
    ;;
  restart|force-reload)
    echo -n "Restarting music player daemon: mpd"
    start-stop-daemon --start --quiet --exec /usr/bin/mpd
    sleep 2
    start-stop-daemon --stop --quiet --exec /usr/bin/mpd
    echo "."
    ;;
  *)
    echo "Usage: /etc/init.d/mpd {start|stop|restart|force-reload}"
    exit 1
esac

exit 0