4 # description: Startup/shutdown script for MiniDLNA daemon
6 # $Id: minidlna.init.d.script,v 1.3 2010/11/11 23:48:13 jmaggard Exp $
8 # author: Thomas Bernard
9 # website: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
11 # Copyright (c) 2006-2008, Thomas Bernard
12 # All rights reserved.
14 # Redistribution and use in source and binary forms, with or without
15 # modification, are permitted provided that the following conditions are met:
16 # * Redistributions of source code must retain the above copyright
17 # notice, this list of conditions and the following disclaimer.
18 # * Redistributions in binary form must reproduce the above copyright
19 # notice, this list of conditions and the following disclaimer in the
20 # documentation and/or other materials provided with the distribution.
21 # * The name of the author may not be used to endorse or promote products
22 # derived from this software without specific prior written permission.
24 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 # POSSIBILITY OF SUCH DAMAGE.
36 MINIDLNA
=/usr
/sbin
/minidlna
37 ARGS
='-f /etc/minidlna.conf'
39 test -f $MINIDLNA ||
exit 0
41 .
/lib
/lsb
/init-functions
44 start
) log_daemon_msg
"Starting minidlna" "minidlna"
45 start-stop-daemon
--start --quiet --pidfile /var
/run
/minidlna.pid
--startas $MINIDLNA -- $ARGS $LSBNAMES
48 stop
) log_daemon_msg
"Stopping minidlna" "minidlna"
49 start-stop-daemon
--stop --quiet --pidfile /var
/run
/minidlna.pid
52 restart|reload|force-reload
)
53 log_daemon_msg
"Restarting minidlna" "minidlna"
54 start-stop-daemon
--stop --retry 5 --quiet --pidfile /var
/run
/minidlna.pid
55 start-stop-daemon
--start --quiet --pidfile /var
/run
/minidlna.pid
--startas $MINIDLNA -- $ARGS $LSBNAMES
58 *) log_action_msg
"Usage: /etc/init.d/minidlna {start|stop|restart|reload|force-reload}"