diff options
author | Chris Gianelloni <wolf31o2@gentoo.org> | 2008-02-02 14:01:55 +0000 |
---|---|---|
committer | Chris Gianelloni <wolf31o2@gentoo.org> | 2008-02-02 14:01:55 +0000 |
commit | cf62564fc8f41d8e08fe6f6a28a2ac1960d55e5f (patch) | |
tree | 3e0436ccb9ec8d317d5005e338529df16c65a76d /app-misc/dnetc/files | |
parent | unused versions. (diff) | |
download | gentoo-2-cf62564fc8f41d8e08fe6f6a28a2ac1960d55e5f.tar.gz gentoo-2-cf62564fc8f41d8e08fe6f6a28a2ac1960d55e5f.tar.bz2 gentoo-2-cf62564fc8f41d8e08fe6f6a28a2ac1960d55e5f.zip |
Version bump with a modified ebuild from Michael Hordijk <hoffbrinkle@hotmail.com> and edited by me. Closing bug #177091.
(Portage version: 2.1.4.1)
Diffstat (limited to 'app-misc/dnetc/files')
-rw-r--r-- | app-misc/dnetc/files/dnetc.confd | 18 | ||||
-rw-r--r-- | app-misc/dnetc/files/dnetc.initd | 84 |
2 files changed, 102 insertions, 0 deletions
diff --git a/app-misc/dnetc/files/dnetc.confd b/app-misc/dnetc/files/dnetc.confd new file mode 100644 index 000000000000..f6f0da6b7e2d --- /dev/null +++ b/app-misc/dnetc/files/dnetc.confd @@ -0,0 +1,18 @@ +# configuration file for dnetc + +# Startup will look for configuration files in the following places, using the +# first one that it finds: +# 1. /etc/dnetc.conf +# 2. /opt/distributed.net/dnetc.ini + +# Values specified here will override those found in any client configuration +# file. + +# email adress +EMAIL= + +# buffer base dir +BUFFER_BASE_DIR=/var/spool/dnetc + +# keyserver address +KEYSERVER_ADDRESS= diff --git a/app-misc/dnetc/files/dnetc.initd b/app-misc/dnetc/files/dnetc.initd new file mode 100644 index 000000000000..d3613acf3898 --- /dev/null +++ b/app-misc/dnetc/files/dnetc.initd @@ -0,0 +1,84 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-misc/dnetc/files/dnetc.initd,v 1.1 2008/02/02 14:01:55 wolf31o2 Exp $ + +opts="${opts} reload fetch flush" + +depend() { + use net +} + +processOpts() { + local retVal=1 + + DNETPATH="/opt/distributed.net" + DNETBIN="${DNETPATH}/dnetc" + + STARTOPTS="--start --chuid dnetc:dnetc --quiet \ + --exec ${DNETBIN}" + + DNETOPTS="-quiet" + + if [ -e /etc/conf.d/dnetc ] ; then + retVal=0 + DNETOPTS="${DNETOPTS} -ini /etc/conf.d/dnetc" + elif [ -e ${DNETPATH}/dnetc.ini ]; then + retVal=0 + DNETOPTS="${DNETOPTS} -ini ${DNETPATH}/dnetc.ini" + elif [ ! -z ${EMAIL} ]; then + retVal=0 + fi + + # override ini settings with values in /etc/conf.d/dnetc + + DNETOPTS="${DNETOPTS} ${EMAIL:+-e ${EMAIL}}" + if [ ! -z ${BUFFER_BASE_DIR} ] ; then + local buff_in="${BUFFER_BASE_DIR:+${BUFFER_BASE_DIR}/}buff-in" + local buff_out="${BUFFER_BASE_DIR:+${BUFFER_BASE_DIR}/}buff-out" + DNETOPTS="${DNETOPTS} -inbase ${buff_in}" + DNETOPTS="${DNETOPTS} -outbase ${buff_out}" + fi + DNETOPTS="${DNETOPTS} ${KEYSERVER_ADDRESS:+-a ${KEYSERVER_ADDRESS}}" + + if [ ${retVal} -ne 0 ] ; then + eerror "Need some sort of configuration. Check /etc/conf.d/dnetc." + fi + + return ${retVal} +} + +start() { + processOpts || return 1 + ebegin "Starting distributed.net client" + start-stop-daemon ${STARTOPTS} -- ${DNETOPTS} + eend ${?} +} + +stop() { + processOpts || return 1 + ebegin "Stopping distributed.net client" + start-stop-daemon --stop --quiet --exec ${DNETBIN} -- + eend ${?} +} + +reload() { + processOpts || return 1 + ebegin "Reloading distributed.net client" + start-stop-daemon --stop --quiet --signal HUP --exec ${DNETBIN} + eend ${?} +} + +fetch() { + processOpts || return 1 + ebegin "Fetching distributed.net client buffers" + ${DNETBIN} ${DNETOPTS} -fetch + eend ${?} +} + +flush() { + processOpts || return 1 + ebegin "Flushing distributed.net client buffers" + ${DNETBIN} ${DNETOPTS} -flush + eend ${?} +} |