wok rev 10908

mpd: add init script (thanks Mali)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Jul 26 11:44:53 2011 +0200 (2011-07-26)
parents 8b08d40c9825
children 821ab7663f4e
files mpd/receipt mpd/stuff/etc/init.d/mpd
line diff
     1.1 --- a/mpd/receipt	Mon Jul 25 16:44:28 2011 +0200
     1.2 +++ b/mpd/receipt	Tue Jul 26 11:44:53 2011 +0200
     1.3 @@ -40,6 +40,7 @@
     1.4  	mkdir -p $fs/etc
     1.5  	cp -a $_pkg/usr/bin/mpd $fs/usr/sbin
     1.6  	cp $_pkg/usr/share/doc/mpd/mpdconf.example $fs/etc/mpd.conf
     1.7 +	cp -a $stuff/* $fs
     1.8  }
     1.9  
    1.10  post_install()
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/mpd/stuff/etc/init.d/mpd	Tue Jul 26 11:44:53 2011 +0200
     2.3 @@ -0,0 +1,41 @@
     2.4 +#!/bin/sh
     2.5 +# /etc/init.d/mpd: Start, stop and restart mpd deamon on SliTaz, at boot
     2.6 +# time or with the command line.
     2.7 +#
     2.8 +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS
     2.9 +# variable of /etc/rcS.conf and configure options with /etc/mpd.conf.
    2.10 +#
    2.11 +. /etc/init.d/rc.functions
    2.12 +
    2.13 +NAME=mpd
    2.14 +DESC="Music Player Daemon"
    2.15 +DAEMON=/usr/sbin/mpd
    2.16 +OPTION="/etc/mpd.conf"
    2.17 +
    2.18 +case "$1" in
    2.19 +start)
    2.20 +	echo -n "Starting $DESC: $NAME... "
    2.21 +	$DAEMON $OPTION 2> /dev/null
    2.22 +	status
    2.23 +	;;
    2.24 +stop)
    2.25 +	echo -n "Stopping $DESC: $NAME... "
    2.26 +	$DAEMON --kill 2> /dev/null
    2.27 +	status
    2.28 +	;;
    2.29 +restart)
    2.30 +	echo -n "Restarting $DESC: $NAME... "
    2.31 +	$DAEMON --kill 2> /dev/null
    2.32 +	sleep 2
    2.33 +	$DAEMON $OPTION 2> /dev/null
    2.34 +	status
    2.35 +	;;
    2.36 +*)
    2.37 +	echo ""
    2.38 +	echo -e "33[1mUsage:33[0m /etc/init.d/basename $0 [start|stop|restart]"
    2.39 +	echo ""
    2.40 +	exit 1
    2.41 +	;;
    2.42 +esac
    2.43 +
    2.44 +exit 0