aboutsummaryrefslogtreecommitdiff
path: root/net-p2p/mldonkey/files
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2005-06-24 07:39:10 +0000
committerPav Lucistnik <pav@FreeBSD.org>2005-06-24 07:39:10 +0000
commita783900c29f2cbe2831daa086b612f62c50603a0 (patch)
tree43778e27ff63440dcdf9c5774c271604b590bafb /net-p2p/mldonkey/files
parent440676eb15e8ad0853c638241de8af3527bebd3d (diff)
- Update to 2.5.28.1
- Add rc script [1] PR: ports/82467 Submitted by: Jose M Rodriguez <josemi@freebsd.jazztel.es> Approved by: Holger Lamm <holger@e-gitt.net> (maintainer) [1] Submitted by: hq via maintainer
Notes
Notes: svn path=/head/; revision=137957
Diffstat (limited to 'net-p2p/mldonkey/files')
-rw-r--r--net-p2p/mldonkey/files/kill_mldonkey27
-rw-r--r--net-p2p/mldonkey/files/mlnet.sh61
2 files changed, 76 insertions, 12 deletions
diff --git a/net-p2p/mldonkey/files/kill_mldonkey b/net-p2p/mldonkey/files/kill_mldonkey
index 17a7de100aad..71c40bc1ac83 100644
--- a/net-p2p/mldonkey/files/kill_mldonkey
+++ b/net-p2p/mldonkey/files/kill_mldonkey
@@ -1,4 +1,7 @@
+#!/bin/sh
#
+# $FreeBSD$
+
# Copyright (c) 2003
# Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
# Holger Lamm <holger@e-gitt.net>
@@ -26,26 +29,26 @@
# SUCH DAMAGE.
#
-#!/bin/sh
-
#
# Add Username and password here
# like this:
#
-HTTPUSER="you"
-HTTPPASS="yourpassword"
-
-# Add location and port of mldonkey core
-HTTPURL="127.0.0.1:4080"
+#MLNETUSER="admin"
+#MLNETPASS=""
+#MLNETHOST="127.0.0.1"
+#MLNETPORT="4080"
# internal configuration
HTTP_COMMAND="/usr/bin/fetch"
-HTTP_COMMAND_ARGS="-1 -q -s"
+HTTP_COMMAND_ARGS="-1 -q -s -o /dev/null"
-if [ -n "${HTTPUSER}" -a -n "${HTTPPASS}" ]
-then
- export HTTP_AUTH=basic:*:${HTTPUSER}:${HTTPPASS}
+if [ -n "${MLNETPASS}" ]; then
+ export HTTP_AUTH=basic:*:${MLNETUSER:-admin}:${MLNETPASS}
fi
-${HTTP_COMMAND} ${HTTP_COMMAND_ARGS} "http://${HTTPURL}/submit?q=kill"
+exec > /dev/null 2>&1
+
+${HTTP_COMMAND} ${HTTP_COMMAND_ARGS} \
+ "http://${MLNETHOST:-127.0.0.1}:${MLNETPORT:-4080}/submit?q=kill" \
+ 2>&1 > /dev/null
diff --git a/net-p2p/mldonkey/files/mlnet.sh b/net-p2p/mldonkey/files/mlnet.sh
new file mode 100644
index 000000000000..41a0b866eae8
--- /dev/null
+++ b/net-p2p/mldonkey/files/mlnet.sh
@@ -0,0 +1,61 @@
+#!/bin/sh
+# $FreeBSD$
+
+# PROVIDE: mlnet
+# REQUIRE: LOGIN
+# KEYWORD: FreeBSD shutdown
+
+mlnet_enable=${mlnet_enable:-"NO"}
+mlnet_http_port=${mlnet_http_port:-"4080"}
+mlnet_logfile=${mlnet_logfile:-"/var/log/mlnet"}
+
+. %%RC_SUBR%%
+
+name=mlnet
+rcvar=`set_rcvar`
+command="%%PREFIX%%/bin/${name}"
+start_cmd="${name}_start"
+stop_cmd="${name}_stop"
+
+mlnet_conf="%%PREFIX%%/etc/mlnet.conf"
+required_files="${mlnet_conf}"
+mlnet_user=${mlnet_user:-"mlnet"}
+
+if [ -r ${mlnet_conf} ] ; then
+ . ${mlnet_conf}
+fi
+
+mlnet_url="http://"
+if [ -n "${mlnet_http_user}" -a -n "${mlnet_http_password}" ] ; then
+ mlnet_url="${mlnet_url}${mlnet_http_user}:${mlnet_http_password}@"
+fi
+mlnet_url="${mlnet_url}localhost:${mlnet_http_port}"
+
+mlnet_start() {
+ if checkyesno mlnet_enable ; then
+ echo -n " mlnet"
+ su ${mlnet_user} -c "${command} \
+ ${mlnet_flags} \
+ -daemon \
+ -http_port ${mlnet_http_port}" \
+ >>${mlnet_logfile} 2>&1
+ fi
+}
+
+mlnet_stop() {
+ if checkyesno mlnet_enable ; then
+ echo -n " mlnet"
+ %%LOCALBASE%%/bin/wget --spider -q \
+ "${mlnet_url}/submit?q=close_fds" \
+ >>${mlnet_logfile} 2>&1
+ %%LOCALBASE%%/bin/wget --spider -q \
+ "${mlnet_url}/submit?q=save" \
+ >>${mlnet_logfile} 2>&1
+ %%LOCALBASE%%/bin/wget --spider -q \
+ "${mlnet_url}/submit?q=kill" \
+ >>${mlnet_logfile} 2>&1
+ fi
+}
+
+load_rc_config ${name}
+run_rc_command "$1"