nsbin/torrent_handler/start.sh
Nico Schottelius df2daf524d init
Signed-off-by: Nico Schottelius <nico@manager.schottelius.org>
2017-07-19 17:15:41 +02:00

22 lines
529 B
Bash
Executable file

#!/bin/sh
#set -x
TOPABS=$(cd $(dirname $0); pwd -P)
TORDIR="$TOPABS/torrents"
LOGDIR="$TOPABS/logs"
OUTDIR="$TOPABS/out"
DNLOADR="$TOPABS/downloader.sh"
rm -f "${LOGDIR}/"*
# place downloads into current diretory/out
cd "$OUTDIR"
for torrent in ${TORDIR}/*; do
logfile="$LOGDIR/$(basename "$torrent")"
#echo screen -d -m btdownloadcurses --max_upload_rate 1 "$torrent" G "$logfile"
#screen -d -m btdownloadheadless --max_upload_rate 1 "$torrent" > "$logfile"
screen -d -m "$DNLOADR" "$torrent" "$logfile"
done