How to stop the transfer-cli

I am using a ruby โ€‹โ€‹script to download the bitcoin bootstrap.dat file, this file can only be downloaded using the torrent client, so I use the following ruby โ€‹โ€‹script demo to load on the command line:

#!/usr/bin/ruby env
`transmission-cli https://bitcoin.org/bin/blockchain/bootstrap.dat.torrent`

Now i have run the script

root@master:~# ruby demo

But this script freezes because the transfer uploads torrent files above, but after that it starts visiting and downloading and never ends automatically. Is there a way I can end this using my script?

Is there any way by which I can send a kill or end signal after the torrent download is complete?

+4
source share
1 answer

-f, -finish <script>, script, :

tmpfile=$(mktemp)
chmod a+x $tmpfile
echo "killall transmission-cli" > $tmpfile
transmission-cli -f $tmpfile your.torrent

rtorrent, .

+3

All Articles