-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlauncher.sh
54 lines (40 loc) · 877 Bytes
/
launcher.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# Change this to your netid
netid=pxs142130
#
# Root directory of your project
PROJDIR=$HOME
#
# This assumes your config file is named "config.txt"
# and is located in your project directory
#
CONFIG=$PROJDIR/config.txt
#
# Directory your java classes are in
#
BINDIR=$PROJDIR
#
# Your main project class
#
PROG=Launcher
START=dc01
ID=1
n=1
cat $CONFIG | sed -e "s/#.*//" | sed -e "/^\s*$/d" |
(
read i
echo $i
while read line
do
host=$( echo $line | awk '{ print $1 }' )
#ssh
if [[ $host != "start" && $host != "broadcast" && $host != $START || $n != $ID ]];then
if [[ $host != "start" && $host != "broadcast" && $host != "nocsreq" && $host != "csduration" && $host != "delaybtwcs" ]];then
ssh $netid@$host java $PROG $n &
fi
fi
n=$(( n + 1 ))
done
)
sleep 10s
ssh $netid@$START java $PROG $ID