Merge pull request #95 from TomJansen/master
tpb: start transmission-daemon if it is not running
This commit is contained in:
commit
53fa60e3dd
1 changed files with 18 additions and 13 deletions
|
@ -11,6 +11,7 @@
|
|||
# you can add -- at the end to indicate end of options
|
||||
# (if your program supports it, most do)
|
||||
program='/usr/bin/transmission-remote -a'
|
||||
daemon='transmission-daemon'
|
||||
TPB="https://thepiratebay.org"
|
||||
|
||||
# show N first matches by default
|
||||
|
@ -140,8 +141,10 @@ if [ -z "$down" ] ; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
# download all torrents in list
|
||||
# starts daemon if it was not already running and download all torrents in list
|
||||
echo -n "Downloading torrent(s): "
|
||||
if ! [ "$(pidof $daemon)" ]; then
|
||||
$daemon
|
||||
for torrent in $down ; do
|
||||
# check if ID is valid and in range of results, download torrent
|
||||
if [ $torrent -ge 1 ] ; then
|
||||
|
@ -156,6 +159,8 @@ for torrent in $down ; do
|
|||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
echo
|
||||
if [ -n "$report" ] ; then
|
||||
echo -n "Exited with errors:"
|
||||
|
|
Loading…
Reference in a new issue