-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcleanup.sh
49 lines (36 loc) · 823 Bytes
/
cleanup.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
#!/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
#
#
# Your main project class
#
PROG=Launcher
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 }' )
#echo $host
if [[ $host != "start" && $host != "broadcast" && $host != "nocsreq" && $host != "csduration" && $host != "delaybtwcs" ]];then
#if [[ $host != "start" && $host != "broadcast" ]]; then
ssh $netid@$host killall -u $netid &
sleep 1
fi
n=$(( n + 1 ))
done
)
echo "Cleanup complete"