#!/sbin/runscript # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ depend() { need net } start() { ebegin "Starting MiniDLNA" local params="" local stop=0 if [[ "${RESCAN}" = "true" || "{$RESCAN}" = yes ]]; then params="$params -R" fi #set the config file and check if it exists if [ -z "${CONFIG}" ]; then if [ ! -f "/etc/minidlna.conf" ]; then ewarn "You did not set the config file correctly" stop=1 fi params="$params -f /etc/minidlna.conf" else if [ ! -f "${CONFIG}" ]; then ewarn "The specified config file does not exist" stop=1 fi params="$params -f ${CONFIG}" fi if [ $stop -eq 1 ]; then eend 1 else start-stop-daemon --start \ --exec /usr/sbin/minidlna -- ${params} eend $? fi } stop() { ebegin "Stopping MiniDLNA" start-stop-daemon --stop --quiet --exec /usr/sbin/minidlna eend $? }