All pastes #1650883 Raw Edit

rtorrent daemon script

public text v1 · immutable
#1650883 ·published 2009-10-31 21:22 UTC
rendered paste body
#!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-p2p/rtorrent/files/rtorrentd.init,v 1.3 2009/07/28 21:52:33 robbat2 Exp $

PID=`pidof -o %PPID /usr/bin/rtorrent`

depend() {
	use net ypbind nis
	after slapd mysqld postgresql
}

start() {
	ebegin "Starting rtorrent"
    [ -z "$PID" ] && su - $USER -c "screen -c /home/iliander/.screen/.screenrc-rtorrent -U -S bt -d -m rtorrent rtorrent "
	eend $?
}

stop() {
	ebegin "Stopping rtorrent"
    [ ! -z "$PID" ] && su - $USER -c "kill -2 $PID &>>/dev/null" >>/dev/null
	eend $?
}