Hallo
Einen kleinen Schnippsel zusammen geklatscht.
Um mir den Status der Torrents auf den OSD anzeigen zu lassen, folgende Geschichten werden benötigt:
Plugin: http://vdr-wiki.de/wiki/index.php/Bgprocess-plugin
Rtorrent: http://libtorrent.rakshasa.no
Rtorrent, ist wie folgt starten:
Code
shell> screen -dmS rtorrent /usr/bin/rtorrent -o upload_rate=13,check_hash=no,dht=auto -d /video0/torrents /video0/torrents/*.torrent
^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
wichtig für dump optionen speicherort hier werden die *.torrent(s) erwartet
Schnippsel:
Bash
#!/bin/bash
#
# rtorrent.sh
# CONFIG START
SVDRPSENDCMD="svdrpsend.pl -p 2001 -d 127.0.0.1"
DELAY=""
# CONFIG END
while : ; do
screen -ls | awk '/rtorrent/ { print $1 }' | xargs -i screen -p rtorrent -S {} -X hardcopy /tmp/rtorrent.dump
count=0
while read i ; do
count=$((count+1))
var=${i/*Uploaded:*/@@@}
if [ -z "${var/*@@@*/}" ] ; then
label=${i%% *}
status=${i/*[/}
status=${status/\%]*/}
eval x="\$value$count"
sleep 1s
if [ -z "${i/* done */}" ] ; then
status=100
fi
eval value$count=\("${x:-$(date +%s)}"\ "$label"\ "$status"\)
eval $SVDRPSENDCMD PLUG bgprocess PROCESS torrent "\$value$count" "\${value$count[2]}" "\${value$count[1]}" >/dev/null
fi
done < <(egrep -s -B1 '%|done' /tmp/rtorrent.dump | egrep -v '^--|OPEN|Hashing' | paste - -)
sleep ${DELAY:-20}s
if ! pidof rtorrent >/dev/null ; then
for i in $(seq $count) ; do
eval x="\$value$i"
if [ "$x" ] ; then
eval $SVDRPSENDCMD PLUG bgprocess PROCESS torrent "\$value$i" "101" "\${value$i[1]}" >/dev/null
fi
done
break
fi
done
Alles anzeigen
Villeicht kann es wer gebrauchen.
LG Ronny