diff options
author | Caleb Tennis <caleb@gentoo.org> | 2003-08-07 02:25:57 +0000 |
---|---|---|
committer | Caleb Tennis <caleb@gentoo.org> | 2003-08-07 02:25:57 +0000 |
commit | b74a8a2c597f99b2e573b237aa420cc54b11e071 (patch) | |
tree | 25e09238e07398d4df512ca553f7ded248cb1760 /net-p2p/mldonkey/files | |
parent | fix license/repoman (diff) | |
download | gentoo-2-b74a8a2c597f99b2e573b237aa420cc54b11e071.tar.gz gentoo-2-b74a8a2c597f99b2e573b237aa420cc54b11e071.tar.bz2 gentoo-2-b74a8a2c597f99b2e573b237aa420cc54b11e071.zip |
Added functionality, thanks to Julian Hoch (closes bug #25695)
Diffstat (limited to 'net-p2p/mldonkey/files')
-rw-r--r-- | net-p2p/mldonkey/files/digest-mldonkey-2.5.3-r1 | 1 | ||||
-rw-r--r-- | net-p2p/mldonkey/files/mldonkey.confd | 19 | ||||
-rw-r--r-- | net-p2p/mldonkey/files/mldonkey.initd | 60 |
3 files changed, 80 insertions, 0 deletions
diff --git a/net-p2p/mldonkey/files/digest-mldonkey-2.5.3-r1 b/net-p2p/mldonkey/files/digest-mldonkey-2.5.3-r1 new file mode 100644 index 000000000000..a3f450f18754 --- /dev/null +++ b/net-p2p/mldonkey/files/digest-mldonkey-2.5.3-r1 @@ -0,0 +1 @@ +MD5 d11504a6dd1e8b5f955951d1f73236ed mldonkey-2.5-3.sources.tar.gz 2373194 diff --git a/net-p2p/mldonkey/files/mldonkey.confd b/net-p2p/mldonkey/files/mldonkey.confd new file mode 100644 index 000000000000..60c35b082fa8 --- /dev/null +++ b/net-p2p/mldonkey/files/mldonkey.confd @@ -0,0 +1,19 @@ +# config file for mldonkey control script + +# owner of mlnet process (don't change, must be existing) +MLUSER="p2p" + +# home dir of owner (don't change, must be existing) +MLHOME="/home/p2p" + +# subdir if any (will be created, if not existing) +MLDIR=".mldonkey" + +# bandwidth control, values in kb/s +MLLOWDOWN="6" +MLLOWUP="2" +MLHIGHDOWN="30" +MLHIGHUP="10" + +# port for webinterface, usually 4080 +MLPORT="4080" diff --git a/net-p2p/mldonkey/files/mldonkey.initd b/net-p2p/mldonkey/files/mldonkey.initd new file mode 100644 index 000000000000..b7e45b71f118 --- /dev/null +++ b/net-p2p/mldonkey/files/mldonkey.initd @@ -0,0 +1,60 @@ +#!/sbin/runscript + +opts="start stop restart slow fast" + +depend() { + need net +} + +start() { + ebegin "Starting mldonkey" + if [ ! -d ${MLHOME}/${MLDIR} ] + then + einfo "Directory ${MLHOME}/${MLDIR} not existing, trying to create..." + su ${MLUSER} -c "mkdir ${MLHOME}/${MLDIR}" + if [ ! -d ${MLHOME}/${MLDIR} ] + then + eerror "Directory ${MLHOME}/${MLDIR} could not be created!" + return 1 + fi + einfo "...ok!" + fi + cd ${MLHOME}/${MLDIR}/ + start-stop-daemon --quiet --start \ + --exec /usr/bin/mlnet -x /usr/bin/mlnet -c ${MLUSER} &>/dev/null & + eend $? +} + +stop() { + ebegin "Stopping mldonkey - please wait" + wget http://$DONKSRV:4080/submit?q=close_fds -q -O - > /dev/null + wget http://$DONKSRV:4080/submit?q=save -q -O -> /dev/null + sleep 10 + start-stop-daemon --stop -x /usr/bin/mlnet + eend $? +} + +restart() { + svc_stop + svc_start +} + +slow() { + ebegin "Reducing bandwidth to ${MLLOWDOWN}k/${MLLOWUP}k" + + wget http://localhost:${MLPORT}/submit?q=set+max_hard_download_rate+${MLLOWDOWN} -q -O - > /dev/null + + wget http://localhost:${MLPORT}/submit?q=set+max_hard_upload_rate+${MLLOWUP} -q -O - > /dev/null + + eend $? +} + +fast() { + ebegin "Increasing bandwidth to ${MLHIGHDOWN}k/${MLHIGHUP}k" + + wget http://localhost:${MLPORT}/submit?q=set+max_hard_download_rate+${MLHIGHDOWN} -q -O - > /dev/null + + wget http://localhost:${MLPORT}/submit?q=set+max_hard_upload_rate+${MLHIGHUP} -q -O - > /dev/null + + eend $? +} |