summaryrefslogtreecommitdiff
path: root/community/mldonkey
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-02-09 23:14:54 +0000
committerroot <root@rshg054.dnsready.net>2012-02-09 23:14:54 +0000
commit4bc61018eec54dbe50e7556ce01d2ef2859b2c9f (patch)
tree3ea5705a573fd320639395f484fc12335e0a1b88 /community/mldonkey
parent54b7119c36756b86ea463649ee972cd6c1ce5863 (diff)
Thu Feb 9 23:14:54 UTC 2012
Diffstat (limited to 'community/mldonkey')
-rw-r--r--community/mldonkey/PKGBUILD6
-rw-r--r--community/mldonkey/mldonkeyd44
2 files changed, 34 insertions, 16 deletions
diff --git a/community/mldonkey/PKGBUILD b/community/mldonkey/PKGBUILD
index ea5a0f175..fc9961fb1 100644
--- a/community/mldonkey/PKGBUILD
+++ b/community/mldonkey/PKGBUILD
@@ -1,11 +1,11 @@
-# $Id: PKGBUILD 63664 2012-02-05 12:04:35Z ibiru $
+# $Id: PKGBUILD 64114 2012-02-08 23:57:08Z cbrannon $
# Maintainer: Chris Brannon <cmbrannon79@gmail.com>
# Contributor: Corrado Primier <bardo@aur.archlinux.org>
# Contributor: Alessio 'mOLOk' Bolognino <themolok@gmail.com>
pkgname=mldonkey
pkgver=3.1.0
-pkgrel=2
+pkgrel=3
pkgdesc="A multi-network P2P client"
arch=('i686' 'x86_64')
url="http://mldonkey.sourceforge.net/"
@@ -41,6 +41,6 @@ package() {
install -Dm644 "$srcdir/mldonkey.conf" "$pkgdir/etc/conf.d/mldonkey"
}
md5sums=('072726d158ba1e936c554be341e7ceff'
- '75e4b6c7fb282f7de15a8d5478f3bd70'
+ '9e90003a012cf17b548dcc647961ffa6'
'1f86d92db51c62cded0e6f3833057dee'
'1de3266caa49f82bee73ba891eea12cf')
diff --git a/community/mldonkey/mldonkeyd b/community/mldonkey/mldonkeyd
index 6a458d68e..533aa751c 100644
--- a/community/mldonkey/mldonkeyd
+++ b/community/mldonkey/mldonkeyd
@@ -1,8 +1,8 @@
#!/bin/bash
. /etc/rc.conf
-. /etc/conf.d/mldonkey
. /etc/rc.d/functions
+. /etc/conf.d/mldonkey
if [ -z $MLDUSER ] ; then
echo "Unable to run MLDonkey. You must set a user in /etc/conf.d/mldonkey ."
@@ -27,7 +27,10 @@ fi
PIDDIR="/var/run/mldonkey"
PIDFILE="$PIDDIR/mlnet.pid"
-PID=$(cat $PIDFILE 2>/dev/null)
+
+getPID() {
+ echo $(pgrep -u "$MLDUSER" mlnet 2>/dev/null);
+}
case "$1" in
start)
@@ -46,19 +49,34 @@ case "$1" in
stat_done
fi
;;
- stop)
- stat_busy "Stopping MLDonkey"
- [ ! -z $PID ] && kill $PID &> /dev/null
- if [ $? -gt 0 ]; then
- stat_fail
- else
- rm_daemon mldonkey
- stat_done
- fi
- ;;
+ stop)
+ stat_busy "Stopping MLDonkey"
+ if [ ! -z "$(getPID)" ]; then
+ timeo=30
+ kill $(getPID) &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ fi
+ while [ ! -z "$(getPID)" -a $timeo -gt 0 ]; do
+ sleep 1
+ let timeo=${timeo}-1
+ done
+ if [ -z "$(getPID)" ]; then
+ rm -f $PIDFILE &>/dev/null
+ rm_daemon mldonkey
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
restart)
$0 stop
- sleep 1
$0 start
;;
*)