summaryrefslogtreecommitdiff
path: root/testing/mpd/rc.d
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-03-23 00:01:14 +0000
committerroot <root@rshg054.dnsready.net>2012-03-23 00:01:14 +0000
commit1512c792951d7fbd2c9c336f9bf35654bbb85cc6 (patch)
treed786dcc22bc7f01d7629eb8a07415d2a904fc015 /testing/mpd/rc.d
parent39e662ccfbe62ae77d458159d192816171a22f43 (diff)
Fri Mar 23 00:01:14 UTC 2012
Diffstat (limited to 'testing/mpd/rc.d')
-rwxr-xr-xtesting/mpd/rc.d27
1 files changed, 27 insertions, 0 deletions
diff --git a/testing/mpd/rc.d b/testing/mpd/rc.d
new file mode 100755
index 000000000..86f77419f
--- /dev/null
+++ b/testing/mpd/rc.d
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+[[ -d /run/mpd ]] || install -d -g mpd -o mpd /run/mpd
+
+case "$1" in
+ start)
+ stat_busy 'Starting Music Player Daemon'
+ /usr/bin/mpd /etc/mpd.conf &> /dev/null &&
+ { add_daemon mpd; stat_done; } || stat_fail
+ ;;
+ stop)
+ stat_busy 'Stopping Music Player Daemon'
+ /usr/bin/mpd --kill /etc/mpd.conf &> /dev/null &&
+ { rm_daemon mpd; stat_done; } || stat_fail
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0