ControlScripts: move start/stop functions to a script in ConfigFiles
authorRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Tue, 3 Aug 2010 14:34:23 +0000 (17:34 +0300)
committerRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Tue, 3 Aug 2010 14:34:23 +0000 (17:34 +0300)
ControlScripts/client_schedule.sh

index 733fe7b..fc40be0 100755 (executable)
@@ -7,6 +7,7 @@
 #  * starts/stops a client
 #  * manages when client completes
 
+# use _DEBUG="off" to turn off debug printing
 _DEBUG="on"
 
 DEBUG()
@@ -22,6 +23,9 @@ fi
 # Read the global configuration variables
 source ../ConfigFiles/globalconfig.txt
 
+# Read client mappings configuration file
+source ../ConfigFiles/client_script_mappings
+
 client_type=$1
 torrent_file=$2
 
@@ -47,24 +51,16 @@ parse_periods()
        done
 }
 
-start_client()
-{
-       DEBUG echo "starting client ..."
-}
-
-stop_client()
-{
-       DEBUG echo "stopping client ..."
-}
-
 suspend_client()
 {
        DEBUG echo "suspending client ..."
+       kill -STOP ${client_pid}
 }
 
 resume_client()
 {
        DEBUG echo "resuming client ..."
+       kill -CONT ${client_pid}
 }
 
 parse_periods