Skip to content

Instantly share code, notes, and snippets.

@bixu
Created August 7, 2015 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bixu/5fa1b59f480f205ba07c to your computer and use it in GitHub Desktop.
Save bixu/5fa1b59f480f205ba07c to your computer and use it in GitHub Desktop.
Store your torrent downloads (for example, the latest Slackware Linux ISO) directly in Manta from within an `mjob` or `mlogin` session.
#!/bin/bash
# "An elegant weapon, from a more civilized age."
MAGNET_URL=$1
transmission-daemon
sleep 3
transmission-remote localhost --encryption-required --uplimit 1 --add $MAGNET_URL
while [ $(transmission-remote localhost --list | grep -v "^ID\|Sum" | grep -c "100%\|Seeding") -ne 1 ]
do
transmission-remote localhost --list
if [ $(transmission-remote localhost --list | grep -v "^ID\|Sum" | grep -c "100%\|Seeding") -ge 1 ]; then
pkill transmission
npm install manta-sync
./node_modules/.bin/manta-sync /root/Downloads/ ~~/stor/Downloads/
exit
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment