165bbda1c3d0caa156bac76a04993b895a14c9d5
[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
8 #
9
10 if [ $! -ne 1 ]; then
11         echo "usage: $0 data_file"
12         exit 1
13 fi
14
15 filename=$1
16
17 tracker_url_array=( http://10.3.8.1:6969 http://10.3.8.2:6969
18 http://10.3.8.3:6969 http://10.3.8.4:6969
19 http://10.3.8.5:6969 http://10.3.8.6:6969
20 http://10.3.8.7:6969 http://10.3.8.8:6969
21 http://10.3.8.9:6969 http://10.3.8.10:6969
22 http://10.3.8.11:6969 http://10.3.8.12:6969 )
23
24 for url_item in ${tracker_url_array[@]}; do             
25         if [ -e $filename ]; then
26                 echo "Making $filename.tracker$index.torrent for"
27                 echo "  tracker_index: $index, tracker_url: $url_item"
28                 btmakemetafile $url_item/announce $filename --target $filename.tracker$index.torrent
29         else
30                 echo "Warning: $filename does not exist."
31         fi
32         index=$(($index + 1))
33 done