summaryrefslogtreecommitdiffstats
path: root/tests/integration_base_files/cleanup.sh
blob: 42fb5a434d5ca0133a1d9de8d97e35369cdfa210 (plain)
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
#! /bin/bash
echo checking and killing open servers

# Find all java processes, except
# * grep, as we're running it
# * get-lock, as that one is just waiting for this cleanup to happen
# * shutdown-and-cleanup, as that could be the one we're running from 
ps x | grep -E bin/java | grep -v grep | grep -v get-lock | grep -v shutdown-and-cleanup | awk '{print $1}' > temp
     
#Read and kill processes marked to temp
while read line
do
  kill -9 $line
done < temp
      
#Remove temp
rm temp
   
if [ -a /home/integration/demo.war ]
  then
    echo removing old demo.war
    rm /home/integration/demo.war
fi
     
echo Cleaning deploy dir
rm -rf /home/integration/deploy/*