From: Razvan Deaconescu Date: Tue, 3 Aug 2010 14:34:47 +0000 (+0300) Subject: ConfilFiles: add client_script_mappings shell config file X-Git-Tag: classic-scenario-config~5 X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=cce1e3e1d578fe8b8804c84b000c710e860a5eb9;p=p2p-testing-infrastructure.git ConfilFiles: add client_script_mappings shell config file --- diff --git a/ConfigFiles/client_script_mappings b/ConfigFiles/client_script_mappings new file mode 100644 index 0000000..e86992a --- /dev/null +++ b/ConfigFiles/client_script_mappings @@ -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 +}