2010-11-14 14:13:48 -01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2013-11-26 00:50:52 -01:00
|
|
|
HTTPBASE="http://cdimage.debian.org/cdimage"
|
|
|
|
|
2010-11-14 14:13:48 -01:00
|
|
|
for FILE in $@; do
|
2013-11-26 00:50:52 -01:00
|
|
|
MKTORRENT=btmakemetafile.bittornado
|
2010-11-14 14:13:48 -01:00
|
|
|
ISODIR=`dirname $FILE`
|
|
|
|
BTDIR=`echo $ISODIR | sed 's/iso-/bt-/;s/usb-/bt-/'`
|
|
|
|
if [ ! -d $BTDIR ] ; then
|
|
|
|
mkdir -p $BTDIR
|
|
|
|
fi
|
2013-11-26 00:50:52 -01:00
|
|
|
|
|
|
|
# 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}"
|
2010-11-14 14:13:48 -01:00
|
|
|
$MKTORRENT http://bttracker.debian.org:6969/announce \
|
|
|
|
--comment '"Debian CD from cdimage.debian.org"' \
|
2013-11-26 00:50:52 -01:00
|
|
|
--httpseeds ${HTTP1}\|${HTTP2} \
|
2010-11-14 14:13:48 -01:00
|
|
|
$FILE | grep -v complete
|
|
|
|
mv $FILE.torrent $BTDIR
|
|
|
|
done
|