aboutsummaryrefslogtreecommitdiff
path: root/net/mpd/files
diff options
context:
space:
mode:
authorArchie Cobbs <archie@FreeBSD.org>2003-11-22 20:51:05 +0000
committerArchie Cobbs <archie@FreeBSD.org>2003-11-22 20:51:05 +0000
commit6d59990c70507aca152519e7b55018f6ef19614f (patch)
tree1020051d84bb0c0b2d6cd46eab4c9092305f89bf /net/mpd/files
parentad07707ba0bd21be8e810a0ee60d97adde81fa2c (diff)
downloadports-6d59990c70507aca152519e7b55018f6ef19614f.tar.gz
ports-6d59990c70507aca152519e7b55018f6ef19614f.zip
Notes
Diffstat (limited to 'net/mpd/files')
-rw-r--r--net/mpd/files/mpd.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/net/mpd/files/mpd.sh b/net/mpd/files/mpd.sh
new file mode 100644
index 000000000000..01df6bfab322
--- /dev/null
+++ b/net/mpd/files/mpd.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+# $FreeBSD$
+
+DAEMON=/usr/local/sbin/mpd
+PIDFILE=/var/run/mpd.pid
+
+case "$1" in
+start)
+ if [ -f "${DAEMON}" -a -x "${DAEMON}" ]; then
+ if [ -f "${PIDFILE}" ]; then
+ echo ' mpd PID file found - not starting'
+ else
+ "${DAEMON}" -b -p "${PIDFILE}"
+ echo -n ' mpd'
+ fi
+ else
+ echo ' "${DAEMON}" executable not found - mpd not starting'
+ fi
+ ;;
+stop)
+ if [ -f "${PIDFILE}" ]; then
+ read -r pid junk < "${PIDFILE}"
+ kill ${pid}
+ else
+ echo ' mpd PID file not found - not killing'
+ fi
+ ;;
+restart)
+ $0 stop
+ sleep 2
+ $0 start
+ ;;
+*)
+ echo "usage: ${0##*/} {start|stop|restart}" >&2
+ ;;
+esac
+