]> git.pld-linux.org Git - packages/mpd.git/commitdiff
- initial
authorZsolt Udvari <uzsolt@pld-linux.org>
Wed, 5 Nov 2008 17:09:43 +0000 (17:09 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- mpd init script

Changed files:
    mpd.init -> 1.1

mpd.init [new file with mode: 0644]

diff --git a/mpd.init b/mpd.init
new file mode 100644 (file)
index 0000000..4abdf7f
--- /dev/null
+++ b/mpd.init
@@ -0,0 +1,60 @@
+#!/bin/sh
+#
+# chkconfig:   2345 85 15
+#
+# description: Music Player Daemon
+#
+# processname: mpd
+# pidfile:     /var/run/mpd/mpd.pid
+# config:      /etc/mpd.conf
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+start() {
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/mpd ]; then
+               msg_starting "mpd"
+               OPTIONS=""
+               daemon mpd
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/mpd
+       else
+               msg_already_running "mpd"
+       fi
+}
+
+stop() {
+       if [ -f /var/lock/subsys/mpd ]; then
+               msg_stopping "mpd"
+               killproc mpd
+               rm -f /var/lock/subsys/mpd >/dev/null 2>&1
+       else
+               msg_not_running "mpd"
+       fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart|force-reload)
+       stop
+       start
+       ;;
+  status)
+       status mpd
+       exit $?
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|force-reload|status}"
+       exit 3
+esac
+
+exit $RETVAL
+
This page took 0.291554 seconds and 4 git commands to generate.