Skip to content

Instantly share code, notes, and snippets.

@ctroncoso
Created April 5, 2012 04:54
Show Gist options
  • Save ctroncoso/2308062 to your computer and use it in GitHub Desktop.
Save ctroncoso/2308062 to your computer and use it in GitHub Desktop.
# Let's make a new folder for our torrents
mkdir new_torrents
# now we search for all our torrents and change the tracker.
# The new tracker is 4 charaters longer than the old one, so it should increase the length of the string
# From 70 to 74.
# PLEASE CHECK YOUR ANNOUNCER STRING IS 70 CHARACTERS LONG BEFORE RUNNING THE NEXT COMMAND
# To check, do a 'head -n1 whatever.torrent" on an old torrent. It should start like this:
# "d8:announce70:http://tracker.preto.me......."
# if after announce, there is a number different than 70, then adjust accordingly
# i.e. if it is d8:announce72, then the new tracker will be length 76
# you have been warned
# **************************
for i in *.torrent
do
cat "$i" | sed 's?70:http://tracker.preto.me:2710?74:http://tracker.pretome.info:8080?g' > "new_torrents/$i"
done
# OK, now you should have your new torrents on the "new_torrents" directory.
# let's make a directory for your old files... just in case.
mkdir old_torrents
# and now let's move them there
mv *.torrent old_torrents
# and now lets bring the now files and remove the folder
mv new_torrents/* .
rmdir new_torrents
# The old_torrents folder shouldn't bother, but I'd move them out of the
# torrents directory into somewhere to keep them as backup... just in case.
# ^^^ That is for you to do.
# Good luck!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment