summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaúl Porcel <armin76@gentoo.org>2007-01-24 17:40:27 +0000
committerRaúl Porcel <armin76@gentoo.org>2007-01-24 17:40:27 +0000
commitd9d4c033a4c78f7278b1297d894dbe40c18cae8e (patch)
tree3da044a35325c00188949da45846e6ad23e5b394 /net-p2p/mldonkey/files
parentkerry version bump (diff)
downloadhistorical-d9d4c033a4c78f7278b1297d894dbe40c18cae8e.tar.gz
historical-d9d4c033a4c78f7278b1297d894dbe40c18cae8e.tar.bz2
historical-d9d4c033a4c78f7278b1297d894dbe40c18cae8e.zip
Drop old , add new initd script and confd, thanks to Christian Schlotter <again at gmx at de>, bug 141177
Package-Manager: portage-2.1.2-r2
Diffstat (limited to 'net-p2p/mldonkey/files')
-rw-r--r--net-p2p/mldonkey/files/digest-mldonkey-2.6.4-r22
-rw-r--r--net-p2p/mldonkey/files/digest-mldonkey-2.7.32
-rw-r--r--net-p2p/mldonkey/files/digest-mldonkey-2.7.6-r13
-rw-r--r--net-p2p/mldonkey/files/digest-mldonkey-2.8.23
-rw-r--r--net-p2p/mldonkey/files/mldonkey-2.7.3-configure.patch20
-rw-r--r--net-p2p/mldonkey/files/mldonkey-2.7.6-magic.patch173
-rw-r--r--net-p2p/mldonkey/files/mldonkey.confd-2.839
-rw-r--r--net-p2p/mldonkey/files/mldonkey.initd-2.8135
-rw-r--r--net-p2p/mldonkey/files/mldonkey.initd-2.8-r1146
9 files changed, 185 insertions, 338 deletions
diff --git a/net-p2p/mldonkey/files/digest-mldonkey-2.6.4-r2 b/net-p2p/mldonkey/files/digest-mldonkey-2.6.4-r2
deleted file mode 100644
index 984f50fac6f9..000000000000
--- a/net-p2p/mldonkey/files/digest-mldonkey-2.6.4-r2
+++ /dev/null
@@ -1,2 +0,0 @@
-MD5 d969f81b51e194fcaf46790686269e3e mldonkey-2.6.4.tar.bz2 2669228
-MD5 20be3ad138fb9f6bec908591db14585e mldonkey_protocol_handler-1.7.xpi 5502
diff --git a/net-p2p/mldonkey/files/digest-mldonkey-2.7.3 b/net-p2p/mldonkey/files/digest-mldonkey-2.7.3
deleted file mode 100644
index 8a6b4c6e1979..000000000000
--- a/net-p2p/mldonkey/files/digest-mldonkey-2.7.3
+++ /dev/null
@@ -1,2 +0,0 @@
-MD5 f6c7c183fda53a9e9c26a09f8cdefda7 mldonkey-2.7.3.tar.bz2 2807272
-MD5 20be3ad138fb9f6bec908591db14585e mldonkey_protocol_handler-1.7.xpi 5502
diff --git a/net-p2p/mldonkey/files/digest-mldonkey-2.7.6-r1 b/net-p2p/mldonkey/files/digest-mldonkey-2.7.6-r1
deleted file mode 100644
index 51aedc0ddf3d..000000000000
--- a/net-p2p/mldonkey/files/digest-mldonkey-2.7.6-r1
+++ /dev/null
@@ -1,3 +0,0 @@
-MD5 08e3cccce6fe65f5437a309276fe2c68 mldonkey-2.7.6.tar.bz2 2835134
-RMD160 8989e86e26b6b4ed4fc8f783093c6e187b6d5051 mldonkey-2.7.6.tar.bz2 2835134
-SHA256 ec5e5723cc54c4ac3ef93e0b78ed9da58c4e75ca09fa4b2de4c9a58740085fa8 mldonkey-2.7.6.tar.bz2 2835134
diff --git a/net-p2p/mldonkey/files/digest-mldonkey-2.8.2 b/net-p2p/mldonkey/files/digest-mldonkey-2.8.2
deleted file mode 100644
index 04ea99d280aa..000000000000
--- a/net-p2p/mldonkey/files/digest-mldonkey-2.8.2
+++ /dev/null
@@ -1,3 +0,0 @@
-MD5 123aeb79a3ca91a4943b59f044e98d4a mldonkey-2.8.2.tar.bz2 2652074
-RMD160 ce95184805ac8f4c690e37c75d418b5f7e265f92 mldonkey-2.8.2.tar.bz2 2652074
-SHA256 51efc1c339b8cbafde93f4444f18e4243f41008b1c4107a41602542e9eeaa68e mldonkey-2.8.2.tar.bz2 2652074
diff --git a/net-p2p/mldonkey/files/mldonkey-2.7.3-configure.patch b/net-p2p/mldonkey/files/mldonkey-2.7.3-configure.patch
deleted file mode 100644
index dd29f404bda2..000000000000
--- a/net-p2p/mldonkey/files/mldonkey-2.7.3-configure.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- configure.in.old 2006-04-27 20:46:37.000000000 +0200
-+++ configure.in 2006-04-27 20:46:53.000000000 +0200
-@@ -331,7 +331,7 @@
- OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
- case "$OCAMLVERSION" in
- "$REQUIRED_OCAML"*) ;;
-- 3.09.0*) ;;
-+ 3.09.*) ;;
- 3.08.4*) ;;
- 3.08.3*) ;;
- *)
-@@ -464,7 +464,7 @@
- REBUILD_OCAML=no
- case "$OCAMLVERSION" in
- "$REQUIRED_OCAML"*) ;;
-- 3.09.0*) ;;
-+ 3.09.*) ;;
- 3.08.4*) ;;
- 3.08.3*) ;;
- *)
diff --git a/net-p2p/mldonkey/files/mldonkey-2.7.6-magic.patch b/net-p2p/mldonkey/files/mldonkey-2.7.6-magic.patch
deleted file mode 100644
index 04c570c360f8..000000000000
--- a/net-p2p/mldonkey/files/mldonkey-2.7.6-magic.patch
+++ /dev/null
@@ -1,173 +0,0 @@
-diff -uwNr ./org/src/daemon/common/commonFile.ml ./mldonkey-2.7.6/src/daemon/common/commonFile.ml
---- src/daemon/common/commonFile.ml 2006-05-20 01:43:54.000000000 +0200
-+++ src/daemon/common/commonFile.ml 2006-06-13 21:50:56.000000000 +0200
-@@ -450,6 +450,18 @@
- None -> ()
- | Some magic -> (as_file_impl file).impl_file_magic <- Some (HashMagic.merge files_magic magic)
-
-+let check_magic file =
-+ let check file =
-+ match Magic.M.magic_fileinfo (file_disk_name file) false with
-+ None -> ()
-+ | Some magic -> set_file_magic file (Some magic)
-+ in
-+ let magic = file_magic file in
-+ match magic with
-+ None -> check file
-+ | Some magic when magic = "data" || magic = "empty" -> check file
-+ | _ -> ()
-+
- let set_file_last_seen file age =
- let impl = as_file_impl file in
- impl.impl_file_last_seen <- age
-diff -uwNr ./org/src/daemon/common/commonFile.mli ./mldonkey-2.7.6/src/daemon/common/commonFile.mli
---- src/daemon/common/commonFile.mli 2006-05-12 23:08:30.000000000 +0200
-+++ src/daemon/common/commonFile.mli 2006-06-13 21:50:56.000000000 +0200
-@@ -119,7 +119,7 @@
- val file_comment : CommonTypes.file -> string
- val file_magic : CommonTypes.file -> string option
- val set_file_magic : CommonTypes.file -> string option -> unit
--
-+val check_magic : CommonTypes.file -> unit
- val recover_bytes : CommonTypes.file -> (int64 * int64) list
- val file_write : CommonTypes.file -> int64 -> string -> int -> int -> unit
- val file_verify : CommonTypes.file ->
-diff -uwNr ./org/src/daemon/common/commonSwarming.ml ./mldonkey-2.7.6/src/daemon/common/commonSwarming.ml
---- src/daemon/common/commonSwarming.ml 2006-05-20 01:43:54.000000000 +0200
-+++ src/daemon/common/commonSwarming.ml 2006-06-13 21:52:52.000000000 +0200
-@@ -1073,6 +1073,7 @@
- let set_verified_chunk t i =
- t.t_nverified_blocks <- t.t_nverified_blocks + 1;
- t.t_converted_verified_bitmap.[i] <- '3';
-+ if i = 0 && !Autoconf.magic_works then check_magic t.t_file;
- let s = t.t_s in
- if t.t_primary then begin
- (* The primary is supposed to propagate verified chunks to the file *)
-diff -uwNr ./org/src/daemon/driver/driverInteractive.ml ./mldonkey-2.7.6/src/daemon/driver/driverInteractive.ml
---- src/daemon/driver/driverInteractive.ml 2006-05-21 09:50:05.000000000 +0200
-+++ src/daemon/driver/driverInteractive.ml 2006-06-13 21:50:56.000000000 +0200
-@@ -123,23 +123,6 @@
- close_log ()
- end
-
--let file_magic_check () =
-- if !Autoconf.magic_works then begin
-- if !verbose then lprintf_nl "computing file magic values";
-- let check_magic file =
-- match Magic.M.magic_fileinfo (file_disk_name file) false with
-- None -> ()
-- | Some magic -> set_file_magic file (Some magic)
-- in
-- List.iter (fun file ->
-- let magic = file_magic file in
-- match magic with
-- None -> check_magic file
-- | Some magic when magic = "data" -> check_magic file
-- | _ -> ()
-- ) !!files
-- end
--
- (* ripped from gui_downloads *)
-
- let calc_file_eta f =
-diff -uwNr ./org/src/daemon/driver/driverMain.ml ./mldonkey-2.7.6/src/daemon/driver/driverMain.ml
---- src/daemon/driver/driverMain.ml 2006-05-20 01:43:54.000000000 +0200
-+++ src/daemon/driver/driverMain.ml 2006-06-13 21:50:56.000000000 +0200
-@@ -68,7 +68,6 @@
-
- let minute_timer () =
- DriverInteractive.hdd_check ();
-- DriverInteractive.file_magic_check ();
- CommonShared.shared_check_files ();
- CommonUploads.upload_credit_timer ();
- CommonInteractive.force_download_quotas ();
-@@ -436,7 +435,6 @@
-
- (* lprintf "(1) CommonComplexOptions.load\n"; *)
- CommonComplexOptions.load ();
-- DriverInteractive.file_magic_check ();
- CommonUploads.load ();
-
- (* lprintf "(2) CommonComplexOptions.load done\n"; *)
-diff -uwNr ./org/src/networks/bittorrent/bTInteractive.ml ./mldonkey-2.7.6/src/networks/bittorrent/bTInteractive.ml
---- src/networks/bittorrent/bTInteractive.ml 2006-05-20 01:43:54.000000000 +0200
-+++ src/networks/bittorrent/bTInteractive.ml 2006-06-13 21:50:56.000000000 +0200
-@@ -256,14 +256,24 @@
- end in
- print_first_tracker file.file_trackers;
-
-+ let check_magic file =
-+ match Magic.M.magic_fileinfo file false with
-+ None -> None
-+ | Some s -> Some (HashMagic.merge CommonGlobals.files_magic s)
-+ in
- let cntr = ref 0 in
-- List.iter (fun (filename, size, magic) ->
-+ List.iter (fun (filename, size, _) ->
- Printf.bprintf buf "\\</tr\\>\\<tr class=\\\"dl-%d\\\"\\>" (html_mods_cntr ());
- let fs = Printf.sprintf "File %d" !cntr in
- let magic_string =
-- match magic with
-+ if !Autoconf.magic_works then
-+ begin
-+ let subfile = Filename.concat (file_disk_name file) filename in
-+ match check_magic subfile with
- None -> ""
- | Some magic -> Printf.sprintf " / %s" magic
-+ end
-+ else ""
- in
- html_mods_td buf [
- (fs, "sr br", fs);
-@@ -623,32 +633,6 @@
- lprintf_nl "ft_retry: exception %s" (Printexc2.to_string e)
- ) ft_by_num
-
--let file_magic_check () =
-- if !Autoconf.magic_works then begin
-- if !verbose then lprintf_nl "computing sub_file magic values";
-- let check_magic file =
-- match Magic.M.magic_fileinfo file false with
-- None -> None
-- | Some s -> Some (HashMagic.merge CommonGlobals.files_magic s)
-- in
-- Hashtbl.iter (fun _ file ->
-- let updated = ref false in
-- let new_file_files = ref [] in
-- List.iter (fun (filename, size, magic) ->
-- let subfile = Filename.concat (file_disk_name file) filename in
-- let new_magic =
-- match magic with
-- None -> check_magic subfile
-- | Some magic when magic = "data" || magic = "empty" -> check_magic subfile
-- | _ -> magic
-- in
-- if new_magic <> magic then updated := true;
-- new_file_files := (filename, size, new_magic) :: !new_file_files
-- ) file.file_files;
-- if !updated then file.file_files <- !new_file_files
-- ) files_by_uid
-- end
--
- let load_torrent_from_web r ft =
- if !verbose then
- lprintf_nl "Loading torrent from web";
-diff -uwNr ./org/src/networks/bittorrent/bTMain.ml ./mldonkey-2.7.6/src/networks/bittorrent/bTMain.ml
---- src/networks/bittorrent/bTMain.ml 2006-05-20 01:43:54.000000000 +0200
-+++ src/networks/bittorrent/bTMain.ml 2006-06-13 21:50:56.000000000 +0200
-@@ -115,7 +115,6 @@
- BTClients.recover_files ();
- add_session_timer enabler 60.0 (fun timer ->
- BTClients.recover_files ();
-- BTInteractive.file_magic_check ()
- );
-
- add_session_timer enabler 120.0 (fun timer ->
-@@ -131,7 +130,6 @@
- ) !current_files;
- );
-
-- BTInteractive.file_magic_check ();
- BTClients.listen ();
- ()
-
diff --git a/net-p2p/mldonkey/files/mldonkey.confd-2.8 b/net-p2p/mldonkey/files/mldonkey.confd-2.8
new file mode 100644
index 000000000000..1d1f282234f7
--- /dev/null
+++ b/net-p2p/mldonkey/files/mldonkey.confd-2.8
@@ -0,0 +1,39 @@
+# /etc/conf.d/mldonkey
+# Config file for mldonkey control script
+
+# Change the following vars only if you know
+# what you're doing, there's no checking for
+# invalid data yet!
+
+# owner of mlnet process (don't change, must be existing)
+USER="p2p"
+
+# mldonkey's working dir (must be existing)
+MLDONKEY_DIR="/home/p2p/mldonkey"
+
+# logfile (/dev/null for nowhere)
+LOG="/var/log/mldonkey.log"
+
+# set to true, if you have enabled logging to syslog in MLDonkey with
+# set log_to_syslog true
+USE_LOGGER=false
+
+# bandwidth control, values in kb/s
+LOW_DOWN="6"
+LOW_UP="2"
+HIGH_DOWN="30"
+HIGH_UP="10"
+
+# nice level, 0<x<19, more nice -> less cpuspeed consumed
+NICE="19"
+
+# mldonkey server ip, usually localhost
+SERVER="localhost"
+
+# port for webinterface, usually 4080
+PORT="4080"
+
+# to enable password restricted access,
+# uncomment and set BOTH following vars:
+#USERNAME="admin"
+#PASSWORD=""
diff --git a/net-p2p/mldonkey/files/mldonkey.initd-2.8 b/net-p2p/mldonkey/files/mldonkey.initd-2.8
deleted file mode 100644
index e3f8548a9f8a..000000000000
--- a/net-p2p/mldonkey/files/mldonkey.initd-2.8
+++ /dev/null
@@ -1,135 +0,0 @@
-#!/sbin/runscript
-
-opts="start stop restart slow fast info"
-
-depend() {
- need net
-}
-
-start() {
- ebegin "Starting mldonkey"
- result=0
-
- if [ -z "${MLDONKEY_DIR}" ]; then
- ewarn "mldonkey's start script has been changed. You should remove"
- ewarn "BASEDIR and SUBDIR from /etc/conf.d/mldonkey and set MLDONKEY_DIR"
- ewarn "to the correct value (you probably want"
- ewarn "MLDONKEY_DIR=${BASEDIR}/${SUBDIR})"
- MLDONKEY_DIR=${BASEDIR}/${SUBDIR}
- einfo "Using ${MLDONKEY_DIR} as working directory"
- fi
-
- if [ ! -d ${MLDONKEY_DIR} ]; then
- einfo "Directory ${MLDONKEY_DIR} not existing, trying to create..."
- if `mkdir -p ${MLDONKEY_DIR} 2>/dev/null`; then
- chown ${USER}:users ${MLDONKEY_DIR}
- else
- eerror "Directory ${MLDONKEY_DIR} could not be created!"
- ((result++))
- fi
- fi
-
- cd ${MLDONKEY_DIR}
- env MLDONKEY_DIR=${MLDONKEY_DIR} start-stop-daemon --quiet --start \
- -c ${USER} -N ${NICE} -x /usr/bin/mlnet &>${LOG} &
- sleep 5
- if ! pgrep -u ${USER} mlnet >/dev/null
- then
- eerror "MLDonkey could not be started! Check logfile: ${LOG}"
- ((result++))
- fi
- eend $result
-}
-
-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
- # give it a chance to die:
- local timeout=10
- while [ $timeout -gt 0 ] && pgrep -u ${USER} mlnet &>/dev/null; do
- sleep 1
- let 'timeout--'
- done
- 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
- 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
-
- 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|/bin/grep value=\" |/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"
-}
diff --git a/net-p2p/mldonkey/files/mldonkey.initd-2.8-r1 b/net-p2p/mldonkey/files/mldonkey.initd-2.8-r1
new file mode 100644
index 000000000000..d80cf7f4bce7
--- /dev/null
+++ b/net-p2p/mldonkey/files/mldonkey.initd-2.8-r1
@@ -0,0 +1,146 @@
+#!/sbin/runscript
+
+opts="start stop restart reload slow fast info"
+
+MLDONKEY_BINARY=${MLDONKEY_BINARY:-/usr/bin/mlnet}
+MLDONKEY_TIMEOUT=${TIMEOUT:-10}
+
+depend() {
+ need net
+ ${USE_LOGGER} && use logger
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+
+ if [ -z "${MLDONKEY_DIR}" ]; then
+ ewarn "mldonkey's start script has been changed. You should remove"
+ ewarn "BASEDIR and SUBDIR from /etc/conf.d/mldonkey and set MLDONKEY_DIR"
+ ewarn "to the correct value (you probably want"
+ ewarn "MLDONKEY_DIR=${BASEDIR}/${SUBDIR})"
+ MLDONKEY_DIR=${BASEDIR}/${SUBDIR}
+ einfo "Using ${MLDONKEY_DIR} as working directory"
+ fi
+
+ local result=0
+ if [ ! -d ${MLDONKEY_DIR} ]; then
+ einfo "Directory ${MLDONKEY_DIR} not existing, trying to create..."
+ if `mkdir -p ${MLDONKEY_DIR} 2>/dev/null`; then
+ chown ${USER}:users ${MLDONKEY_DIR}
+ else
+ eerror "Directory ${MLDONKEY_DIR} could not be created!"
+ ((result++))
+ fi
+ fi
+
+ cd ${MLDONKEY_DIR}
+ env MLDONKEY_DIR=${MLDONKEY_DIR} start-stop-daemon --quiet --start \
+ -c ${USER} -N ${NICE} -x ${MLDONKEY_BINARY} &>${LOG} &
+ sleep 5
+
+ if ! pgrep -u ${USER} mlnet >/dev/null; then
+ eerror "${SVCNAME} could not be started! Check logfile: ${LOG}"
+ ((result++))
+ fi
+
+ eend $result
+}
+
+setup_uri() {
+ BASE="http://"
+ if [[ -n ${USERNAME} && -n ${PASSWORD} ]]; then
+ BASE=${BASE}${USERNAME}:${PASSWORD}@
+ fi
+ BASE=${BASE}${SERVER}:${PORT}
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME} -- please wait"
+
+ setup_uri
+ wget --spider --timeout=${MLDONKEY_TIMEOUT} ${BASE}/submit?q=close_fds -q
+ wget --spider --timeout=${MLDONKEY_TIMEOUT} ${BASE}/submit?q=save -q
+ wget --spider --timeout=${MLDONKEY_TIMEOUT} ${BASE}/submit?q=kill -q
+
+ # give it a chance to die:
+ local timeout=${MLDONKEY_TIMEOUT}
+ while [ $timeout -gt 0 ] && pgrep -u ${USER} mlnet &>/dev/null; do
+ sleep 1
+ ((timeout--))
+ done
+
+ start-stop-daemon --oknodo --stop -x ${MLDONKEY_BINARY} &>${LOG}
+
+ eend $?
+}
+
+restart() {
+ svc_stop
+ sleep 5
+ svc_start
+}
+
+reload() {
+ if ! service_started ${SVCNAME}; then
+ eerror "${SVCNAME} is not started"
+ return 0
+ fi
+
+ ebegin "Reloading ${SVCNAME}"
+
+ start-stop-daemon --stop --signal HUP --oknodo \
+ --exec ${MLDONKEY_BINARY} &>${LOG}
+
+ eend $?
+}
+
+slow() {
+ if ! service_started ${SVCNAME}; then
+ start_service ${SVCNAME}
+ fi
+
+ ebegin "Reducing bandwidth to ${LOW_DOWN}k/${LOW_UP}k"
+
+ setup_uri
+ wget --spider --timeout=${MLDONKEY_TIMEOUT} \
+ ${BASE}/submit?q=set+max_hard_download_rate+${LOW_DOWN} -q
+ wget --spider --timeout=${MLDONKEY_TIMEOUT} \
+ ${BASE}/submit?q=set+max_hard_upload_rate+${LOW_UP} -q
+
+ eend $?
+}
+
+fast() {
+ if ! service_started ${SVCNAME}; then
+ start_service ${SVCNAME}
+ fi
+
+ ebegin "Increasing bandwidth to ${HIGH_DOWN}k/${HIGH_UP}k"
+
+ setup_uri
+ wget --spider --timeout=${MLDONKEY_TIMEOUT} \
+ ${BASE}/submit?q=set+max_hard_download_rate+${HIGH_DOWN} -q
+ wget --spider --timeout=${MLDONKEY_TIMEOUT} \
+ ${BASE}/submit?q=set+max_hard_upload_rate+${HIGH_UP} -q
+
+ eend $?
+}
+
+
+info() {
+ if ! service_started ${SVCNAME}; then
+ eerror "${SVCNAME} is not started"
+ return 0
+ fi
+
+ setup_uri
+ local result=$(/usr/bin/wget --timeout=${MLDONKEY_TIMEOUT} \
+ -O - ${BASE}/submit?q=vo 2> /dev/null | \
+ /bin/grep -C1 max_hard_upload | \
+ /bin/grep value=\" | /bin/cut -d\" -f2)
+ if [[ ${result} -eq ${LOW_UP} ]]; then
+ einfo "${SVCNAME} runs slow"
+ else
+ einfo "${SVCNAME} runs fast"
+ fi
+}