Commit d660cc97 authored by Natanael Copa's avatar Natanael Copa Committed by Francesco Colista

main/transmission: upgrade to 2.52 and sync init.d script

Copy init.d script from gentoo.
fixes #1119
parent a1df3a7a
# Maintainer:Carlo Landmeter
pkgname=transmission
pkgver=2.51
pkgrel=2
pkgver=2.52
pkgrel=0
pkgdesc="Lightweight GTK BitTorrent client"
url="http://www.tansmissionbt.com"
install="transmission-daemon.pre-install"
......@@ -69,6 +69,6 @@ cli() {
"$subpkgdir"/usr/bin/
}
md5sums="dfe2faeb2b76b43954ec943affef2133 transmission-2.51.tar.bz2
1ca57137d38c3429295a4699f535a240 transmission-daemon.initd
89478a70fcd93463e1dd8d751da994da transmission-daemon.confd"
md5sums="9490ed97a03f7b8b1ac8b0822c3dce92 transmission-2.52.tar.bz2
37c927164a4443db004345c7e19f7795 transmission-daemon.initd
5caf0fc25dfd67c61627f1e0313f4245 transmission-daemon.confd"
#
# transmission-daemon options
#
# -a --acl <list> Access Control List. (Default: +127.0.0.1)
# -b --blocklist Enable peer blocklists
# -B --no-blocklist Disable peer blocklists
# -f --foreground Run in the foreground instead of daemonizing
# -g --config-dir <path> Where to look for configuration files
# -p --port <port> RPC port (Default: 9091)
# -t --auth Require authentication
# -T --no-auth Don't require authentication
# -u --username <username> Set username for authentication
# -v --password <password> Set password for authentication
# -w --download-dir <path> Where to save downloaded data
#
# NOTE: webif does not work without the -f switch
#
TD_OPTS="-f -g /var/lib/transmission/.config -w /var/lib/transmission"
# This is the transmission-daemon configuration file. For other options and
# better explanation, take a look at transmission-daemon manual page Note: it's
# better to configure some settings (like username/password) in
# /var/transmission/config/settings.json to avoid other users see it with `ps`
TRANSMISSION_OPTIONS="--encryption-preferred"
# Run daemon as another user (username or username:groupname)
# If you change this setting, chown -R /var/transmission/config <and download directory, check web settings>
#runas_user=transmission
# Location of logfile (should be writeable for runas_user user)
# Set logfile=syslog to use syslog for logging
#logfile=/var/log/transmission/transmission.log
#!/sbin/runscript
# Copyright 1999-2011 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.8,v 1.2 2011/12/04 10:35:07 swegener Exp $
extra_started_commands="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"
rundir=${rundir:-/var/run/transmission}
pidfile=${pidfile:-${rundir}/transmission.pid}
config_dir=${config_dir:-/var/transmission/config}
download_dir=${download_dir:-/var/transmission/downloads}
logfile=${logfile:-/var/log/transmission/transmission.log}
runas_user=${runas_user:-transmission:transmission}
SSD_OPTIONS=""
# compatibility for upgraders
TRANSMISSION_OPTIONS=${TRANSMISSION_OPTIONS:-$TD_OPTS}
depend() {
need net
need net
after firewall
}
check_config() {
if [ ! -d "${rundir}" ]; then
mkdir "${rundir}"
if [ -n "${runas_user}" ]; then
chown -R ${runas_user} "${rundir}"
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
SSD_OPTIONS="${SSD_OPTIONS} --user ${runas_user}"
fi
}
start() {
ebegin "Starting transmission-daemon"
start-stop-daemon --start --quiet --background --make-pidfile \
--user transmission:transmission \
--pidfile /var/run/transmission-daemon.pid \
--exec /usr/bin/transmission-daemon -- ${TD_OPTS}
eend $?
check_config
ebegin "Starting transmission daemon"
start-stop-daemon --start --quiet --pidfile ${pidfile} ${SSD_OPTIONS} \
--exec /usr/bin/transmission-daemon -- --pid-file ${pidfile} \
$(test ${logfile} != "syslog" && echo --logfile ${logfile}) \
${TRANSMISSION_OPTIONS}
eend $?
}
stop() {
ebegin "Stopping transmission-daemon"
start-stop-daemon --stop --quiet \
--pidfile /var/run/transmission-daemon.pid \
eend $?
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 $?
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment