Utils: add torrent generation script for tsup
authorP2P-Next User <p2p@p2p-next-04-201.grid.pub.ro>
Mon, 25 Oct 2010 10:41:27 +0000 (13:41 +0300)
committerP2P-Next User <p2p@p2p-next-04-201.grid.pub.ro>
Mon, 25 Oct 2010 10:41:27 +0000 (13:41 +0300)
Utils/tsup-experiment/tsup_torrents_gen700.sh [new file with mode: 0755]

diff --git a/Utils/tsup-experiment/tsup_torrents_gen700.sh b/Utils/tsup-experiment/tsup_torrents_gen700.sh
new file mode 100755 (executable)
index 0000000..3c1317b
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/bash
+#
+# Copyright: Calin-Andrei Burloiu 2010 - calin.burloiu@gmail.com
+#
+# Bash script used generate torrent files for the TSUP Experiment
+# The script
+#  * generates a torrent file for each of the 12 trackers, for files of 4MiB, 
+#              16MiB, 64MiB, 256MiB, 1GiB.
+#
+
+tracker_url_array=( 10.3.8.1:6969 10.3.8.2:6969
+10.3.8.3:6969 10.3.8.4:6969
+10.3.8.5:6969 10.3.8.6:6969
+10.3.8.7:6969 10.3.8.8:6969
+10.3.8.9:6969 10.3.8.10:6969
+10.3.8.11:6969 10.3.8.12:6969 )
+
+       index=1
+       for url_item in ${tracker_url_array[@]}; do             
+               filename=Data.700M.bin
+               if [ -e $filename ]; then
+                       echo "Making $filename.tracker$index.torrent for"
+                       echo "  tracker_index: $index, tracker_url: $url_item, file_size: 700M"
+                       btmakemetafile $url_item/announce $filename --target $filename.tracker$index.torrent
+               else
+                       echo "Warning: $filename does not exist."
+               fi
+               index=$(($index + 1))
+       done
+