# HG changeset patch # User Pascal Bellard # Date 1311673493 -7200 # Node ID 6b69e208e7511e5fc8d4a003f2a3e4c22dbf010e # Parent 8b08d40c982594ee70f3fb6652b369933a3a3393 mpd: add init script (thanks Mali) diff -r 8b08d40c9825 -r 6b69e208e751 mpd/receipt --- a/mpd/receipt Mon Jul 25 16:44:28 2011 +0200 +++ b/mpd/receipt Tue Jul 26 11:44:53 2011 +0200 @@ -40,6 +40,7 @@ mkdir -p $fs/etc cp -a $_pkg/usr/bin/mpd $fs/usr/sbin cp $_pkg/usr/share/doc/mpd/mpdconf.example $fs/etc/mpd.conf + cp -a $stuff/* $fs } post_install() diff -r 8b08d40c9825 -r 6b69e208e751 mpd/stuff/etc/init.d/mpd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpd/stuff/etc/init.d/mpd Tue Jul 26 11:44:53 2011 +0200 @@ -0,0 +1,41 @@ +#!/bin/sh +# /etc/init.d/mpd: Start, stop and restart mpd deamon on SliTaz, at boot +# time or with the command line. +# +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS +# variable of /etc/rcS.conf and configure options with /etc/mpd.conf. +# +. /etc/init.d/rc.functions + +NAME=mpd +DESC="Music Player Daemon" +DAEMON=/usr/sbin/mpd +OPTION="/etc/mpd.conf" + +case "$1" in +start) + echo -n "Starting $DESC: $NAME... " + $DAEMON $OPTION 2> /dev/null + status + ;; +stop) + echo -n "Stopping $DESC: $NAME... " + $DAEMON --kill 2> /dev/null + status + ;; +restart) + echo -n "Restarting $DESC: $NAME... " + $DAEMON --kill 2> /dev/null + sleep 2 + $DAEMON $OPTION 2> /dev/null + status + ;; +*) + echo "" + echo -e "33[1mUsage:33[0m /etc/init.d/basename $0 [start|stop|restart]" + echo "" + exit 1 + ;; +esac + +exit 0