ConfilFiles: add client_script_mappings shell config file
authorRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Tue, 3 Aug 2010 14:34:47 +0000 (17:34 +0300)
committerRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Tue, 3 Aug 2010 14:34:47 +0000 (17:34 +0300)
ConfigFiles/client_script_mappings [new file with mode: 0644]

diff --git a/ConfigFiles/client_script_mappings b/ConfigFiles/client_script_mappings
new file mode 100644 (file)
index 0000000..e86992a
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+#
+# Configuration file for mapping client (string) identifiers to
+# start/stop/detect scripts
+#
+
+start_client()
+{
+       local client_type=$1
+       local client_pid=$1
+
+       DEBUG echo "starting client ..."
+       case "${client_type}" in
+       "hrktorrent_seeder")
+               ./start_hrk_seeder.sh ${torrent_file} &
+               return $(pgrep -P $!)
+               ;;
+       "hrktorrent_leecher")
+               ./start_hrk_leecher.sh ${torrent_file} &
+               return $(pgrep -P $!)
+               ;;
+       esac
+}
+
+stop_client()
+{
+       local client_type=$1
+
+       DEBUG echo "stopping client ..."
+       case "${client_type}" in
+       "hrktorrent_seeder")
+               ./stop_hrk.sh
+               ;;
+       "hrktorrent_leecher")
+               ./stop_hrk.sh
+               ;;
+       esac
+}