-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·36 lines (35 loc) · 1020 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
########################################
#Usage for future me #
#Leave IP_ADDR & PORT alone #
#BASENAME is just well the basename #
#...of the client #
#CHILDREN is the number of subprocesses#
#...that will be made #
#run does nothing but read from a file #
#and do noting with it untill its out #
#of lines to read #
#this is because BoggleClient takes its#
#stdin from a file(given by FILE) #
#Basically change children to test load#
#and alter the test[0-9].txt to change #
#the input to the server #
########################################
IP_ADDR=`ip addr show wlan0 | sed -n 's/.*\(192[0-9.]*\)\/.*/\1/p'`
PORT=58839
BASENAME=client
CHILDREN=5
run(){
$JAVA
while read;do
sleep 0.05
done
}
for i in `seq 1 $CHILDREN`; do
NAME="$BASENAME$i"
FILE=test$i.txt
JAVA="java cs671.BoggleClient $NAME $IP_ADDR $PORT $FILE"
(cat $FILE | run ) &>temp$i.txt &
done
wait
rm temp[0-9]*.txt