Advertisement
Guest User

Deluge to ruTorrent script

a guest
Dec 10th, 2018
1,645
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.53 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. sleep 1800
  4.  
  5. torrentid=$1
  6. torrentname=$2
  7. torrentpath=$3
  8.  
  9. downloaddir=$(echo $torrentpath | awk -F '/' '{print $6}')
  10.  
  11. tmpdir=$(mktemp -d)
  12.  
  13. deluge_state_dir=/home/USER/.config/deluge/state
  14. rtorrent_watch_dir=/home/USER/downloads/torrents/${downloaddir}
  15.  
  16. function on_exit() {
  17.     rm -rf "${tmpdir}"
  18. }
  19.  
  20. cp ${deluge_state_dir}/${torrentid}.torrent ${tmpdir}
  21.  
  22. /usr/bin/deluge-console "connect localhost:PORT; rm ${torrentid}"
  23.  
  24. sleep 15
  25.  
  26. cp ${tmpdir}/${torrentid}.torrent ${rtorrent_watch_dir}
  27.  
  28. rm -rf $tmpdir
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement