You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cleanup.sh 674B

1234567891011121314151617181920212223242526
  1. #! /bin/bash
  2. echo checking and killing open servers
  3. # Find all java processes, except
  4. # * grep, as we're running it
  5. # * get-lock, as that one is just waiting for this cleanup to happen
  6. # * shutdown-and-cleanup, as that could be the one we're running from
  7. ps x | grep -E bin/java | grep -v grep | grep -v get-lock | grep -v shutdown-and-cleanup | awk '{print $1}' > temp
  8. #Read and kill processes marked to temp
  9. while read line
  10. do
  11. kill -9 $line
  12. done < temp
  13. #Remove temp
  14. rm temp
  15. if [ -a /home/integration/demo.war ]
  16. then
  17. echo removing old demo.war
  18. rm /home/integration/demo.war
  19. fi
  20. echo Cleaning deploy dir
  21. rm -rf /home/integration/deploy/*