Utils/tsup-experiment: trackers' address updated in tsup_torrents_gen.sh
[p2p-testing-infrastructure.git] / Utils / tsup-experiment / tsup_torrents_gen.sh
1 #!/bin/bash
2 #
3 # Copyright: Calin-Andrei Burloiu 2010 - calin.burloiu@gmail.com
4 #
5 # Bash script used generate torrent files for the TSUP Experiment
6 # The script
7 #  * generates a torrent file for each of the 12 trackers, for files of 4MiB, 
8 #               16MiB, 64MiB, 256MiB, 1GiB.
9 #
10
11 tracker_url_array=( p2p-next-08.grid.pub.ro:30169 p2p-next-08.grid.pub.ro:30269 
12 p2p-next-08.grid.pub.ro:30369 p2p-next-08.grid.pub.ro:30469
13 p2p-next-08.grid.pub.ro:30569 p2p-next-08.grid.pub.ro:30669
14 p2p-next-08.grid.pub.ro:30769 p2p-next-08.grid.pub.ro:30869
15 p2p-next-08.grid.pub.ro:30969 p2p-next-08.grid.pub.ro:31069
16 p2p-next-08.grid.pub.ro:31169 p2p-next-08.grid.pub.ro:31269 )
17
18 for i in 4M 16M 64M 256M 1024M; do
19         index=1
20         for url_item in ${tracker_url_array[@]}; do             
21                 filename=Data.$i
22                 if [ -e $filename ]; then
23                         echo "Making $filename.tracker$index.torrent for"
24                         echo "  tracker_index: $index, tracker_url: $url_item, file_size: $i"
25                         btmakemetafile $url_item/announce $filename --target $filename.tracker$index.torrent
26                 else
27                         echo "Warning: $filename does not exist."
28                 fi
29                 index=$(($index + 1))
30         done
31 done