Created
October 2, 2020 01:38
-
-
Save flyingdan/bdc9d5b4efbfc2e159da2daf4617dcce to your computer and use it in GitHub Desktop.
Script to add magnet links to tranmission
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
/bin/rm /watch/emptied* # clear flag | |
tr=$(which transmission-remote) # set path for transmission-remote binary | |
for t in /watch/*.magnet; do | |
m=$(cat "$t") # get contents of magnet file | |
$tr --add $m # add to transmission | |
/bin/rm "$t" # delete the magnet file | |
done | |
for t in /watch/*.torrent; do | |
$tr --add $t # add to transmission | |
/bin/rm "$t" # delete torrent file | |
done | |
touch /watch/emptied-$(/bin/date +%Y%m%d-%H%M%S) # make emptied flag to indicate script was run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment