summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2010-11-10 12:53:30 +0000
committerPeter Volkov <pva@gentoo.org>2010-11-10 12:53:30 +0000
commit7f42c93d12ac653e85c3a175be752032a045fb95 (patch)
treee4d49fcd53d61631625004f8692238061badacc9 /net-p2p/transmission/files
parentarm stable, bug #344571 (diff)
downloadgentoo-2-7f42c93d12ac653e85c3a175be752032a045fb95.tar.gz
gentoo-2-7f42c93d12ac653e85c3a175be752032a045fb95.tar.bz2
gentoo-2-7f42c93d12ac653e85c3a175be752032a045fb95.zip
Update regex to match beginning of the word, bug #342849 thank Sok Ann Yap for report and fix.
(Portage version: 2.1.9.24/cvs/Linux x86_64)
Diffstat (limited to 'net-p2p/transmission/files')
-rw-r--r--net-p2p/transmission/files/transmission-daemon.initd.571
1 files changed, 71 insertions, 0 deletions
diff --git a/net-p2p/transmission/files/transmission-daemon.initd.5 b/net-p2p/transmission/files/transmission-daemon.initd.5
new file mode 100644
index 000000000000..e2ee41ee29a8
--- /dev/null
+++ b/net-p2p/transmission/files/transmission-daemon.initd.5
@@ -0,0 +1,71 @@
+#!/sbin/runscript
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-p2p/transmission/files/transmission-daemon.initd.5,v 1.1 2010/11/10 12:53:30 pva Exp $
+
+opts="start stop reload"
+description="Transmission is a fast, easy and free bittorrent client"
+description_start="Start transmission-daemon server and web interface"
+description_stop="Stop transmission-daemon server and web interface"
+description_reload="Reload transmission-daemon settings"
+
+pidfile=/var/run/transmission/transmission.pid
+config_dir=/var/transmission/config
+download_dir=/var/transmission/downloads
+logfile=${logfile:-/var/log/transmission/transmission.log}
+runas_user=${runas_user:-transmission:transmission}
+
+SSD_OPTIONS=""
+
+depend() {
+ need net
+}
+
+check_config() {
+ if [ ! -d /var/run/transmission/ ]; then
+ mkdir /var/run/transmission/
+ if [ -n "${runas_user}" ]; then
+ chown -R ${runas_user} /var/run/transmission/
+ fi
+ fi
+
+ # In case no config directory option passed use default
+ if ! $(echo ${TRANSMISSION_OPTIONS} | grep -q -e '\b-g' -e '\b--config-dir'); then
+ TRANSMISSION_OPTIONS="${TRANSMISSION_OPTIONS} --config-dir ${config_dir}"
+ # put download dir location on first run (and take it from config later)
+ if [ ! -f ${config_dir}/settings.json ]; then
+ TRANSMISSION_OPTIONS="${TRANSMISSION_OPTIONS} --download-dir ${download_dir}"
+ fi
+ fi
+
+ if [ -n "${runas_user}" ]; then
+ if [ -f /etc/init.d/sysfs ]; then
+ SSD_OPTIONS="${SSD_OPTIONS} --user ${runas_user}"
+ else
+ SSD_OPTIONS="${SSD_OPTIONS} --chuid ${runas_user}"
+ fi
+ fi
+}
+
+start() {
+ check_config
+
+ ebegin "Starting transmission daemon"
+ start-stop-daemon --start --quiet --background --pidfile ${pidfile} ${SSD_OPTIONS} \
+ --exec /usr/bin/transmission-daemon -- --pid-file ${pidfile} --logfile ${logfile} \
+ ${TRANSMISSION_OPTIONS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping transmission daemon"
+ start-stop-daemon --stop --quiet --retry TERM/45/QUIT/15 --pidfile ${pidfile}
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading transmission configuration"
+ start-stop-daemon --signal HUP --pidfile ${pidfile}
+ eend $?
+}
+