Merges George changes
[p2p-testing-infrastructure.git] / ControlScripts / clients / tribler / start_tribler_leecher.sh
1 #!/bin/bash
2 #
3 # Copyright: George Milescu 2010 - george.milescu@gmail.com
4 #
5 # Bash script used to start a regular (non doe, non proxy) instance of tribler cmd-line
6 # The script
7 #  * changes current working directory to proxyservice-m32
8 #  * starts a tribler cmd-line instance with the supplied .torrent file. The .torrent file must be located in the TorrentsAndData folder
9 #  * at the end deletes the downloaded data
10 #
11 # If you run this script manually, you must run it from the P2P-Testing-Infrastructure/ControlScripts folder and use one argument: the torrent file name that will be loaded from the TorrentsAndData folder
12 #
13
14 # Read the global configuration file
15 # Check if the global configuration file exists
16 if [ ! -e globalconfig ]; then
17         echo "Warning: The global config file globalconfig does not exist."
18 else
19         source globalconfig
20 fi
21
22 # Read the node-specific configuration file (TORRENT_FILE)
23 # Check if the node-specific configuration file exists
24 if [ ! -e ../ClientWorkingFolders/TmpLogs/node_config ]; then
25         echo "Warning: The global config file ../ClientWorkingFolders/TmpLogs/node_config does not exist."
26 else
27         source ../ClientWorkingFolders/TmpLogs/node_config
28 fi
29
30 if [ " $TORRENT_FILE" = " " ]; then 
31         TORRENT_FILE=$1
32 fi
33
34 export PYTHONPATH=$PYTHONPATH:.
35
36 cd $TRIBLER_REL_PATH
37
38 python2.6 Tribler/Tools/proxy-cmdline.py --proxyservice off --test-mode off --port 25124 --state-dir $WORKING_FOLDER_REL_PATH/Regular/statedir --output-dir $WORKING_FOLDER_REL_PATH/Regular/ $WORKING_FOLDER_REL_PATH/TorrentsAndData/$TORRENT_FILE
39
40 rm -rf $WORKING_FOLDER_REL_PATH/Regular/*