stop_linux.sh 529 B

123456789101112131415161718
  1. #!/bin/bash
  2. # Copyright (c) http://www.o2oa.net/
  3. current_dir="$(
  4. cd "$(dirname "$0")"
  5. pwd
  6. )"
  7. cd ${current_dir}
  8. echo "ready to stop o2server path: ${current_dir}"
  9. ${current_dir}/jvm/linux_java11/bin/java -cp ${current_dir}/console.jar com.x.server.console.swapcommand.Exit
  10. sleep 10
  11. PID=$(ps -ef | grep "${current_dir}/jvm/linux_java11/bin/java" | grep -v grep | awk '{print $2}')
  12. if [ "X$PID" != "X" ]; then
  13. sleep 5
  14. if [ "X$PID" != "X" ]; then
  15. echo ready to kill server $PID
  16. kill -9 $PID
  17. fi
  18. fi