Skip to content

Instantly share code, notes, and snippets.

@au5ton
Last active May 9, 2017 04:37
Show Gist options
  • Save au5ton/a54566ebcacd43633cccf31b02b3532b to your computer and use it in GitHub Desktop.
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
#!/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
@au5ton
Copy link
Author

au5ton commented May 9, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment