diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2011-04-12 01:13:45 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2011-04-12 01:13:45 +0000 |
commit | f5ec132210aeeef2010fbf8e483147f5e9cd5a97 (patch) | |
tree | e7b733f24e8da7a7464f56d159ab7905bf233f4d /testing/minidlna/minidlna.initd | |
parent | 82dc433e8bb52ae0f413a69ffc1e4aa201b54487 (diff) | |
download | aports-f5ec132210aeeef2010fbf8e483147f5e9cd5a97.tar.bz2 aports-f5ec132210aeeef2010fbf8e483147f5e9cd5a97.tar.xz |
testing/minidlna: new aport
fixes #576
Diffstat (limited to 'testing/minidlna/minidlna.initd')
-rw-r--r-- | testing/minidlna/minidlna.initd | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/testing/minidlna/minidlna.initd b/testing/minidlna/minidlna.initd new file mode 100644 index 0000000000..bb20626138 --- /dev/null +++ b/testing/minidlna/minidlna.initd @@ -0,0 +1,48 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/minidlna/files/minidlna.initd,v 1.1 2010/12/29 16:59:25 xmw Exp $ + +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 $? +} |