ControlScripts: update client_script_mappings to be aware of scenario_config file
authorRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Fri, 6 Aug 2010 09:16:53 +0000 (12:16 +0300)
committerRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Fri, 6 Aug 2010 09:16:53 +0000 (12:16 +0300)
ConfigFiles/client_script_mappings

index 9d4e11d..a148a86 100644 (file)
@@ -5,19 +5,19 @@
 # start/stop/detect scripts
 #
 
+# Read scenarion configuration file
+source ${BASE_PATH}/ClientWorkingFolders/TmpLogs/scenario_config
+
 start_client()
 {
-       local client_type=$1
-       local torrent_file=$2
-
        DEBUG echo "starting client ..."
-       case "${client_type}" in
+       case "${CLIENT_TYPE}" in
                "hrktorrent_seeder")
-                       ./start_hrk_seeder.sh ${torrent_file} &
+                       ./start_hrk_seeder.sh &
                        return $!
                        ;;
                "hrktorrent_leecher")
-                       ./start_hrk_leecher.sh ${torrent_file} &
+                       ./start_hrk_leecher.sh &
                        return $!
                        ;;
        esac
@@ -25,10 +25,10 @@ start_client()
 
 stop_client()
 {
-       local client_type=$1
+       local CLIENT_TYPE=$1
 
        DEBUG echo "stopping client ..."
-       case "${client_type}" in
+       case "${CLIENT_TYPE}" in
                "hrktorrent_seeder")
                        ./stop_hrk.sh
                        ;;
@@ -40,11 +40,10 @@ stop_client()
 
 detect_complete_client()
 {
-       local client_type=$1
-       local log_file=$2
+       local log_file=$1
 
        DEBUG echo "stopping client ..."
-       case "${client_type}" in
+       case "${CLIENT_TYPE}" in
                "hrktorrent_seeder")
                        ./detect_complete_hrk.sh ${log_file}
                        ;;
@@ -56,12 +55,11 @@ detect_complete_client()
 
 parse_client_log()
 {
-       local client_type=$1
-       local log_folder=$2
-       local log_file=$3
+       local log_folder=$1
+       local log_file=$2
 
        DEBUG echo "stopping client ..."
-       case "${client_type}" in
+       case "${CLIENT_TYPE}" in
                "hrktorrent_seeder")
                        ./parse_hrk.sh ${log_folder} ${log_file}
                        ;;