summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaleb Tennis <caleb@gentoo.org>2003-08-15 15:35:54 +0000
committerCaleb Tennis <caleb@gentoo.org>2003-08-15 15:35:54 +0000
commit67a957c4279158dcd5e02e8b20181ad09c9ef765 (patch)
treed8da5f41fc06e67c174cc6fd8737ddf928e1983a /net-p2p
parentChanged ~sparc keyword to sparc. (diff)
downloadgentoo-2-67a957c4279158dcd5e02e8b20181ad09c9ef765.tar.gz
gentoo-2-67a957c4279158dcd5e02e8b20181ad09c9ef765.tar.bz2
gentoo-2-67a957c4279158dcd5e02e8b20181ad09c9ef765.zip
oops, imported the wrong file
Diffstat (limited to 'net-p2p')
-rw-r--r--net-p2p/mldonkey/files/mldonkey.initd75
1 files changed, 64 insertions, 11 deletions
diff --git a/net-p2p/mldonkey/files/mldonkey.initd b/net-p2p/mldonkey/files/mldonkey.initd
index cc3d2f6bd36a..5d4000322d20 100644
--- a/net-p2p/mldonkey/files/mldonkey.initd
+++ b/net-p2p/mldonkey/files/mldonkey.initd
@@ -1,11 +1,64 @@
-[KDE Desktop Entry]
-Encoding=UTF-8
-Type=Application
-Exec=kbedic
-Icon=/usr/share/kbedic/kbedic_icon_mini.xpm
-Name=KBEDic
-GenericName=English - Bulgarian Dictionary
-GenericName[bg]=Българско-Английски Речник
-Comment=An English - Bulgarian Dictionary
-Comment[bg]=Българско-Английски Речник
-Categories=Qt;KDE;Utility
+#!/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 -c ${MLUSER} \
+ -x /usr/bin/mlnet &>${MLLOG} &
+ sleep 5
+ renice ${MLNICE} -u ${MLUSER} >/dev/null
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping mldonkey - please wait"
+ wget --spider http://$DONKSRV:4080/submit?q=close_fds -q
+ wget --spider http://$DONKSRV:4080/submit?q=save -q
+ wget --spider http://$DONKSRV:4080/submit?q=kill -q
+ sleep 10
+ start-stop-daemon --oknodo --stop -x /usr/bin/mlnet
+ eend $?
+}
+
+restart() {
+ svc_stop
+ sleep 5
+ svc_start
+}
+
+slow() {
+ ebegin "Reducing bandwidth to ${MLLOWDOWN}k/${MLLOWUP}k"
+
+ wget --spider http://localhost:${MLPORT}/submit?q=set+max_hard_download_rate+${MLLOWDOWN} -q
+
+ wget --spider http://localhost:${MLPORT}/submit?q=set+max_hard_upload_rate+${MLLOWUP} -q
+
+ eend $?
+}
+
+fast() {
+ ebegin "Increasing bandwidth to ${MLHIGHDOWN}k/${MLHIGHUP}k"
+
+ wget --spider http://localhost:${MLPORT}/submit?q=set+max_hard_download_rate+${MLHIGHDOWN} -q
+
+ wget --spider http://localhost:${MLPORT}/submit?q=set+max_hard_upload_rate+${MLHIGHUP} -q
+
+ eend $?
+}