Last active
May 9, 2017 04:37
-
-
Save au5ton/a54566ebcacd43633cccf31b02b3532b to your computer and use it in GitHub Desktop.
Creates torrent files for every folder in the current directory with provided announce_url in the first argument
This file contains hidden or 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
#!/bin/bash | |
ANNOUNCE_URL=$1 | |
if [ -z "$ANNOUNCE_URL" ]; then | |
echo "Announce url is undefined, please provide it as an argument"; | |
exit 1; | |
else | |
echo "Provided announce url is: \`"$ANNOUNCE_URL"\`"; | |
fi | |
find . -type d -print0 | while IFS= read -r -d '' folder; do | |
if ! [[ . -ef $folder ]]; then | |
echo $'\t'"Do: "$folder; | |
mktorrent -a $ANNOUNCE_URL --no-date -o "$folder"".torrent" -p "$folder"; | |
echo $'\n'; | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
meant to be ideal for cross-seeding, but I'm having an issue with matching the piece size of the generated torrent with the "original" torrent file.