aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2018-09-06 22:28:41 -0400
committerDeterminant <[email protected]>2018-09-06 22:28:41 -0400
commit05f2c56b909a2cd05a200ad663001696e4a23261 (patch)
treed17807bf16cfc0511d751a14b71ba4e93d56b809 /scripts
parentcbae27f40c310d96af643329a9139a91906ab300 (diff)
update script
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/run_client.sh17
1 files changed, 8 insertions, 9 deletions
diff --git a/scripts/run_client.sh b/scripts/run_client.sh
index f937221..92d3add 100755
--- a/scripts/run_client.sh
+++ b/scripts/run_client.sh
@@ -187,12 +187,10 @@ function start_all {
get_client_info "$workdir/client_list.txt"
echo "coyping configuration file"
rsync -avP "$conf_src" "$tmpldir/$proj_conf_name"
- local nclient="${#cip_list[@]}"
local i=0
- for tuple in "${node_list[@]}"; do
- local cip="${cip_list[$i]}"
- local tup=($(split : "$tuple"))
- local rid="${tup[0]}"
+ local j=0
+ for cip in "${cip_list[@]}"; do
+ local rid="${nodes[$i]}"
local ip="$(get_ip_by_id $rid)"
local pport="$(get_peer_port_by_id $rid)"
local cport="$(get_client_port_by_id $rid)"
@@ -200,12 +198,13 @@ function start_all {
(
echo "Starting a client @ $cip, connecting to server #$rid @ $ip:$cport"
_remote_load "$workdir" "$rworkdir" "$cip"
- _remote_start "$workdir" "$rworkdir" "$i" "$ip" "$cport" "$cip"
- echo "client #$i started"
+ _remote_start "$workdir" "$rworkdir" "$j" "$ip" "$cport" "$cip"
+ echo "client #$j started"
) &
let i++
- if [[ "$i" -eq "$nclient" ]]; then
- break
+ let j++
+ if [[ "$i" -eq "${#nodes[@]}" ]]; then
+ i=0
fi
done
wait