From b72673bacaae5122255437a725478e994262d143 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Thu, 18 Mar 2010 10:22:09 +0100 Subject: [PATCH] added torrent script --- usr/bin/mktorrent-archboot | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 usr/bin/mktorrent-archboot diff --git a/usr/bin/mktorrent-archboot b/usr/bin/mktorrent-archboot new file mode 100755 index 000000000..aaa05a588 --- /dev/null +++ b/usr/bin/mktorrent-archboot @@ -0,0 +1,29 @@ +#!/bin/bash + +# install mktorrent from http://mktorrent.sourceforge.net/ +# check result on e.g. http://torrenteditor.com/ + +if [ "${1}" = "" -o "${2}" = "" ]; then + echo "Usage: ${0} " + echo -e "\tversion:\te.g. 2009.05 or archboot/2009.05" + echo -e "\tiso file:\te.g. ./archlinux-2009.05-core-x86_64.iso" + exit 1 +fi + +archver="${1}" +isofile="${2}" + +echo 'Creating webseeds...' +httpmirrorlist=$(wget http://www.archlinux.org/mirrorlist/i686/all/ -q -O - \ + | grep 'http://' \ + | awk "{print \$3\"/iso/${archver}/\";}" \ + | sed -e 's#/$repo/os/i686##' \ + -e 's#\s*# -w#') + +echo 'Building torrent...' +mktorrent \ + -l 19 \ + -a 'http://tracker.archlinux.org:6969/announce' \ + -c "Arch Linux ${archver} (www.archlinux.org)" \ + ${httpmirrorlist} \ + "${isofile}"