diff options
author | Jon Hood <squinky86@gentoo.org> | 2004-07-30 18:46:16 +0000 |
---|---|---|
committer | Jon Hood <squinky86@gentoo.org> | 2004-07-30 18:46:16 +0000 |
commit | 9981cec96f04d619aed4fb99fa36ec1e24819de4 (patch) | |
tree | b742929e8f571e3d2a43533514b721f61907f9bf /net-p2p | |
parent | move dev-java/avalon-logkit dev-java/avalon-logkit-bin (diff) | |
download | historical-9981cec96f04d619aed4fb99fa36ec1e24819de4.tar.gz historical-9981cec96f04d619aed4fb99fa36ec1e24819de4.tar.bz2 historical-9981cec96f04d619aed4fb99fa36ec1e24819de4.zip |
fix init script irt #58857
Diffstat (limited to 'net-p2p')
-rw-r--r-- | net-p2p/mldonkey/ChangeLog | 6 | ||||
-rw-r--r-- | net-p2p/mldonkey/Manifest | 28 | ||||
-rw-r--r-- | net-p2p/mldonkey/files/mldonkey | 127 | ||||
-rw-r--r-- | net-p2p/mldonkey/files/mldonkey.initd | 34 |
4 files changed, 63 insertions, 132 deletions
diff --git a/net-p2p/mldonkey/ChangeLog b/net-p2p/mldonkey/ChangeLog index 3995a82ee8fe..7de3052246c8 100644 --- a/net-p2p/mldonkey/ChangeLog +++ b/net-p2p/mldonkey/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for net-p2p/mldonkey # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-p2p/mldonkey/ChangeLog,v 1.55 2004/07/27 13:14:20 kang Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-p2p/mldonkey/ChangeLog,v 1.56 2004/07/30 18:46:15 squinky86 Exp $ + + 30 Jul 2004; Jon Hood <squinky86@gentoo.org> files/mldonkey, + files/mldonkey.initd: + fix init script irt #58857 27 Jul 2004; Guillaume Destuynder <kang@gentoo.org> mldonkey-2.5.16-r(4,5,6,7).ebuild, diff --git a/net-p2p/mldonkey/Manifest b/net-p2p/mldonkey/Manifest index d377d96e06f2..3547f41bf5ad 100644 --- a/net-p2p/mldonkey/Manifest +++ b/net-p2p/mldonkey/Manifest @@ -1,22 +1,22 @@ -MD5 74e4ceef69a9fc3a7a76299e5f4d2ed8 metadata.xml 307 +MD5 3f6b03df09ad572b3b04c40c55814222 mldonkey-2.5.16-r7.ebuild 2628 MD5 83b3d337937fcd5d36ab3c7177b85d62 mldonkey-2.5.16-r4.ebuild 2600 -MD5 f442072b0c1b3d1ef2680031562b04fb mldonkey-2.5.16-r5.ebuild 2600 MD5 af2b75c99fbb83ce18de658a0ffa25fe mldonkey-2.5.16-r6.ebuild 2628 -MD5 3f6b03df09ad572b3b04c40c55814222 mldonkey-2.5.16-r7.ebuild 2628 -MD5 e9cf2cdbc9b9ee541731d598963adac9 mldonkey-2.5.21-r1.ebuild 2694 MD5 f2c214aa5ae25b64b54aef4eee0f0759 mldonkey-2.5.21-r2.ebuild 2668 -MD5 9fe19923a9c7ef04a1c3920d5c2faa20 ChangeLog 9634 -MD5 3127e746056c13574b2509e71bc074b5 files/97mldonkey 42 -MD5 97c421f85a3a6aaaeb849d97400f89ca files/digest-mldonkey-2.5.21-r1 125 -MD5 9d632d54e4484981f81a2a912272f57e files/mldonkey 2543 -MD5 d68e3759e1f0f2f9a295bbf0a1c30f6b files/mldonkey-2.5.16-16g.patch 92755 -MD5 be0c71929c461b50601e8715706a4a16 files/mldonkey-2.5.16-configure.patch 540 -MD5 9d462b1fffabccafe674b6138f151ed6 files/mldonkey-2.5.16-oldbt.patch 5713 -MD5 be0c71929c461b50601e8715706a4a16 files/mldonkey-2.5.21-configure.patch 540 +MD5 f442072b0c1b3d1ef2680031562b04fb mldonkey-2.5.16-r5.ebuild 2600 +MD5 e9cf2cdbc9b9ee541731d598963adac9 mldonkey-2.5.21-r1.ebuild 2694 +MD5 fff2b1ae61d2148b39a355d612b08f03 ChangeLog 9756 +MD5 74e4ceef69a9fc3a7a76299e5f4d2ed8 metadata.xml 307 MD5 476ec69e79e7c93a7bdaa6cb049c0857 files/mldonkey.confd 836 -MD5 d9e7f6261a7e566c4e24f870678a8e8b files/mldonkey.initd 1910 +MD5 9d632d54e4484981f81a2a912272f57e files/mldonkey.initd 2543 +MD5 9d462b1fffabccafe674b6138f151ed6 files/mldonkey-2.5.16-oldbt.patch 5713 MD5 a5e46e41c4a0b1a00f6da0e70561427a files/digest-mldonkey-2.5.16-r4 126 MD5 413e60164538b85e9ba290d64e24e63f files/digest-mldonkey-2.5.16-r5 126 MD5 8cb26fa21496d16cfdf0abf0a88fecf2 files/digest-mldonkey-2.5.16-r6 126 -MD5 f145ba120c09f53b0032ea8b3f930128 files/digest-mldonkey-2.5.21-r2 126 MD5 920f9e5989329dba967bff5a111911a7 files/digest-mldonkey-2.5.16-r7 126 +MD5 97c421f85a3a6aaaeb849d97400f89ca files/digest-mldonkey-2.5.21-r1 125 +MD5 f145ba120c09f53b0032ea8b3f930128 files/digest-mldonkey-2.5.21-r2 126 +MD5 d68e3759e1f0f2f9a295bbf0a1c30f6b files/mldonkey-2.5.16-16g.patch 92755 +MD5 be0c71929c461b50601e8715706a4a16 files/mldonkey-2.5.21-configure.patch 540 +MD5 3127e746056c13574b2509e71bc074b5 files/97mldonkey 42 +MD5 ac93ed074d62909b2a496045f0740127 files/mldonkey 336 +MD5 be0c71929c461b50601e8715706a4a16 files/mldonkey-2.5.16-configure.patch 540 diff --git a/net-p2p/mldonkey/files/mldonkey b/net-p2p/mldonkey/files/mldonkey index 84aa9b3db367..6a407cd64679 100644 --- a/net-p2p/mldonkey/files/mldonkey +++ b/net-p2p/mldonkey/files/mldonkey @@ -1,120 +1,15 @@ -#!/sbin/runscript +#!/bin/sh -opts="start stop restart slow fast info" +. /etc/conf.d/mldonkey -depend() { - need net -} - -start() { - ebegin "Starting mldonkey" - if [ ! -d ${BASEDIR}/${SUBDIR} ] - then - einfo "Directory ${BASEDIR}/${SUBDIR} not existing, trying to create..." - su ${USER} -c "mkdir ${BASEDIR}/${SUBDIR}" - if [ ! -d ${BASEDIR}/${SUBDIR} ] - then - eerror "Directory ${BASEDIR}/${SUBDIR} could not be created!" - return 1 - fi - einfo "...ok!" - fi - cd ${BASEDIR}/${SUBDIR}/ - env HOME=${BASEDIR} start-stop-daemon --quiet --start -c ${USER} \ - -x /usr/bin/mlnet &>${LOG} & - sleep 5 - if ! pgrep -u ${USER} mlnet >/dev/null - then - eerror "MLDonkey could not be started! Check logfile: ${LOG}" - fi - renice ${NICE} -u ${USER} >/dev/null - eend $? -} - -stop() { - BASE="http://" - if [[ -n ${USERNAME} && -n ${PASSWORD} ]] - then - BASE=${BASE}${USERNAME}:${PASSWORD}@ - fi - BASE=${BASE}${SERVER}:${PORT} - ebegin "Stopping mldonkey - please wait" - wget --spider ${BASE}/submit?q=close_fds -q - wget --spider ${BASE}/submit?q=save -q - wget --spider ${BASE}/submit?q=kill -q - sleep 10 - start-stop-daemon --oknodo --stop -x /usr/bin/mlnet &>/dev/null - eend $? -} - -restart() { - svc_stop - sleep 5 - svc_start -} - -slow() { - if ! service_started mldonkey - then - start_service mldonkey - fi - ebegin "Reducing bandwidth to ${LOW_DOWN}k/${LOW_UP}k" - - BASE="http://" - if [[ -n ${USERNAME} && -n ${PASSWORD} ]] - then - BASE=${BASE}${USERNAME}:${PASSWORD}@ - fi - BASE=${BASE}${SERVER}:${PORT} - - wget --spider ${BASE}/submit?q=set+max_hard_download_rate+${LOW_DOWN} -q - - wget --spider ${BASE}/submit?q=set+max_hard_upload_rate+${LOW_UP} -q - - eend $? -} - -fast() { - if ! service_started mldonkey - then - start_service mldonkey +if [ ! -d ${HOME}/.mldonkey ] ; then + echo "Creating subdirectory \".mldonkey\" in your home" + echo "to store config files and downloaded files..." + + if ! mkdir ${HOME}/.mldonkey ; then + echo "Creation of subdirectory failed! Exiting..." + exit 1 fi - ebegin "Increasing bandwidth to ${HIGH_DOWN}k/${HIGH_UP}k" - - BASE="http://" - if [[ -n ${USERNAME} && -n ${PASSWORD} ]] - then - BASE=${BASE}${USERNAME}:${PASSWORD}@ - fi - BASE=${BASE}${SERVER}:${PORT} - - wget --spider ${BASE}/submit?q=set+max_hard_download_rate+${HIGH_DOWN} -q +fi - wget --spider ${BASE}/submit?q=set+max_hard_upload_rate+${HIGH_UP} -q - - eend $? -} - - -info() { - if service_started mldonkey - then - BASE="http://" - if [[ -n ${USERNAME} && -n ${PASSWORD} ]] - then - BASE=${BASE}${USERNAME}:${PASSWORD}@ - fi - - BASE=${BASE}${SERVER}:${PORT} - VALUE=$(/usr/bin/wget -O - ${BASE}/submit?q=vo 2> /dev/null| /bin/grep -C1 max_hard_upload|/usr/bin/tail -n 1|/bin/cut -d\" -f2) - if [[ ${VALUE} -eq ${LOW_UP} ]] - then - INFO="mldonkey runs slow" - else - INFO="mldonkey runs fast" - fi - else - INFO="mldonkey is not running" - fi - einfo "$INFO" -} +cd ${HOME}/.mldonkey && exec /usr/bin/mlnet diff --git a/net-p2p/mldonkey/files/mldonkey.initd b/net-p2p/mldonkey/files/mldonkey.initd index ca17ca9654c2..84aa9b3db367 100644 --- a/net-p2p/mldonkey/files/mldonkey.initd +++ b/net-p2p/mldonkey/files/mldonkey.initd @@ -1,6 +1,6 @@ #!/sbin/runscript -opts="start stop restart slow fast" +opts="start stop restart slow fast info" depend() { need net @@ -54,6 +54,10 @@ restart() { } slow() { + if ! service_started mldonkey + then + start_service mldonkey + fi ebegin "Reducing bandwidth to ${LOW_DOWN}k/${LOW_UP}k" BASE="http://" @@ -71,6 +75,10 @@ slow() { } fast() { + if ! service_started mldonkey + then + start_service mldonkey + fi ebegin "Increasing bandwidth to ${HIGH_DOWN}k/${HIGH_UP}k" BASE="http://" @@ -86,3 +94,27 @@ fast() { eend $? } + + +info() { + if service_started mldonkey + then + BASE="http://" + if [[ -n ${USERNAME} && -n ${PASSWORD} ]] + then + BASE=${BASE}${USERNAME}:${PASSWORD}@ + fi + + BASE=${BASE}${SERVER}:${PORT} + VALUE=$(/usr/bin/wget -O - ${BASE}/submit?q=vo 2> /dev/null| /bin/grep -C1 max_hard_upload|/usr/bin/tail -n 1|/bin/cut -d\" -f2) + if [[ ${VALUE} -eq ${LOW_UP} ]] + then + INFO="mldonkey runs slow" + else + INFO="mldonkey runs fast" + fi + else + INFO="mldonkey is not running" + fi + einfo "$INFO" +} |