/usr/share/debian-cd/contrib/mktorrent is in debian-cd 3.1.17.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #!/bin/sh
HTTPBASE="http://cdimage.debian.org/cdimage"
for FILE in $@; do
MKTORRENT=btmakemetafile.bittornado
ISODIR=`dirname $FILE`
BTDIR=`echo $ISODIR | sed 's/iso-/bt-/;s/usb-/bt-/'`
if [ ! -d $BTDIR ] ; then
mkdir -p $BTDIR
fi
# Add 2 http seeds: the release path *and* the archive path -
# hopefully clients will use whichever is available!
VER=$(echo ${FILE} | sed 's,^.*/debian-,,;s,-.*$,,')
HTTP1="${HTTPBASE}/release/${VER}/${FILE}"
HTTP2="${HTTPBASE}/archive/${VER}/${FILE}"
$MKTORRENT http://bttracker.debian.org:6969/announce \
--comment '"Debian CD from cdimage.debian.org"' \
--httpseeds ${HTTP1}\|${HTTP2} \
$FILE | grep -v complete
mv $FILE.torrent $BTDIR
done
|