Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Script to add magnet links to tranmission
#!/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
for t in /watch/*.torrent; do
$tr --add $t # add to transmission
/bin/rm "$t" # delete torrent file
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