41 lines
1.2 KiB
Plaintext
41 lines
1.2 KiB
Plaintext
#!/sbin/openrc-run
|
|
# 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"
|
|
|
|
config_dir="${config_dir:-/var/lib/transmission/config}"
|
|
rundir="${rundir:-/var/run/transmission}"
|
|
|
|
command="/usr/bin/transmission-daemon"
|
|
command_user="${command_user:-transmission:transmission}"
|
|
pidfile="${pidfile:-${rundir}/transmission.pid}"
|
|
command_args="--pid-file ${pidfile}"
|
|
|
|
depend() {
|
|
need net redxen.seedbox-mount
|
|
after firewall redxen.seedbox-mount
|
|
}
|
|
|
|
check_config() {
|
|
command_args="${command_args} --config-dir ${config_dir}"
|
|
}
|
|
|
|
start_pre() {
|
|
check_config
|
|
|
|
checkpath -d -m 750 -o "$command_user" "$rundir"
|
|
checkpath -f -m 440 -o "$command_user" "$config_dir"/settings.json
|
|
}
|
|
|
|
reload() {
|
|
ebegin "Reloading transmission configuration"
|
|
start-stop-daemon --signal HUP --pidfile ${pidfile}
|
|
eend $?
|
|
}
|