diff options
author | root <root@rshg054.dnsready.net> | 2012-01-18 23:14:59 +0000 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2012-01-18 23:14:59 +0000 |
commit | 3e2075427791725d8e6a007feba107d94c017caf (patch) | |
tree | 23ce535075e2575a775e0b14d2b96668d0b6d1b1 /community/minidlna | |
parent | 7de0a9c21ecdb7becae761d7c9f2e723cb9ae0d3 (diff) |
Wed Jan 18 23:14:59 UTC 2012
Diffstat (limited to 'community/minidlna')
-rw-r--r-- | community/minidlna/PKGBUILD | 6 | ||||
-rwxr-xr-x | community/minidlna/minidlna.rc | 51 |
2 files changed, 38 insertions, 19 deletions
diff --git a/community/minidlna/PKGBUILD b/community/minidlna/PKGBUILD index a346dceac..f504cd36b 100644 --- a/community/minidlna/PKGBUILD +++ b/community/minidlna/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 58407 2011-11-12 17:17:53Z ibiru $ +# $Id: PKGBUILD 62167 2012-01-17 08:00:28Z spupykin $ # Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com> # Maintainer:Biginoz < biginoz AT free point fr> # Contributor: Ignacio Galmarino <igalmarino@gmail.com> @@ -6,7 +6,7 @@ pkgname=minidlna pkgver=1.0.22 -pkgrel=4 +pkgrel=5 pkgdesc="A DLNA/UPnP-AV Media server (aka ReadyDLNA)" arch=('i686' 'x86_64') url="http://sourceforge.net/projects/minidlna/" @@ -19,7 +19,7 @@ changelog=changelog source=(http://downloads.sourceforge.net/minidlna/minidlna_${pkgver}_src.tar.gz minidlna.rc) md5sums=('3de2f6b54f43bb998dfad3c8fa75cef3' - '8b064a6c344a3ad8029e2619dfe07b77') + 'b64b8b749f1c23b3f1a2ee6d6ded07fd') build() { cd "$srcdir/$pkgname-$pkgver" diff --git a/community/minidlna/minidlna.rc b/community/minidlna/minidlna.rc index df44a549f..6e6f88f35 100755 --- a/community/minidlna/minidlna.rc +++ b/community/minidlna/minidlna.rc @@ -2,46 +2,65 @@ . /etc/rc.conf . /etc/rc.d/functions -. /etc/minidlna.conf . /etc/conf.d/minidlna -PID=`pidof -o %PPID /usr/sbin/minidlna` +daemon_name=minidlna + +get_pid() { + pidof -o %PPID /usr/sbin/minidlna +} case "$1" in start) stat_busy "Starting minidlna" - [ -z "$PID" ] && su -s /bin/sh -l -c /usr/sbin/minidlna - $MINIDLNA_USER - if [ $? -gt 0 ]; then - stat_fail + PID=$(get_pid) + if [[ -z "$PID" ]]; then + rm -f /var/run/$daemon_name.pid + touch /var/run/$daemon_name.pid && chown $MINIDLNA_USER:$MINIDLNA_USER /var/run/$daemon_name.pid + su -s /bin/sh -l -c /usr/sbin/minidlna - $MINIDLNA_USER + if [[ $? -gt 0 ]]; then + stat_fail + exit 1 + else + add_daemon $daemon_name + stat_done + fi else - add_daemon minidlna - stat_done + stat_fail + exit 1 fi ;; + stop) stat_busy "Stopping minidlna" - [ ! -z "$PID" ] && kill $PID &> /dev/null + PID=$(get_pid) + [[ -n $PID ]] && kill $PID &> /dev/null if [ $? -gt 0 ]; then stat_fail + exit 1 else + rm -f /var/run/$daemon_name.pid &> /dev/null rm_daemon minidlna stat_done fi ;; + clean) - $0 stop - sleep 1 - stat_busy "Cleaning minidlna cache" - [ -z $db_dir ] || rm -r $db_dir/* - stat_done - sleep 1 - $0 start - ;; + $0 stop + sleep 1 + stat_busy "Cleaning minidlna cache" + [ -z $db_dir ] || rm -r $db_dir/* + stat_done + sleep 1 + $0 start + ;; + restart) $0 stop sleep 1 $0 start ;; + *) echo "usage: $0 {start|stop|restart|clean}" esac |