Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. install_folder="/opt/aem"
  4. aem_folder="$install_folder/crx-quickstart"
  5.  
  6. #
  7. # FUNCTION: ts (timestamp)
  8. # DESCRIPTION:
  9. # Generates a timestamp
  10. #
  11. ts() {
  12. date +"%Y-%m-%d %H:%M:%S"
  13. }
  14.  
  15. # grab the PID of the java running process
  16. # jlw: this will break if there is more than one java process running.
  17. # PID=$(pgrep java)
  18.  
  19. PID=$(cat $aem_folder/conf/cq.pid 2>/dev/null)
  20.  
  21. rm -f $aem_folder/conf/cq.pid
  22.  
  23. if ps -p $PID > /dev/null 2>&1; then
  24. kill $PID
  25. echo "$(ts): process ${PID} was killed"
  26. else
  27. echo "$(ts): process ${PID} not running"
  28. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement