restart_linux.sh 627 B

12345678910111213141516
  1. echo ready to stop server $(cd "$(dirname "$0")"; pwd)
  2. $(cd "$(dirname "$0")"; pwd)/jvm/linux/bin/java -javaagent:$(cd "$(dirname "$0")"; pwd)/console.jar -cp $(cd "$(dirname "$0")"; pwd)/console.jar com.x.server.console.swapcommand.Exit
  3. echo 'check server stoped wait 2s-10s'
  4. sleep 2
  5. PID=`ps -ef | grep "$(cd "$(dirname "$0")"; pwd)" | grep -v grep | awk '{print $2}'`
  6. if [ "X$PID" != "X" ]
  7. then
  8. sleep 8
  9. if [ "X$PID" != "X" ]
  10. then
  11. echo ready to kill server $PID
  12. kill -9 $PID
  13. fi
  14. fi
  15. echo 'server stoped ready to start'
  16. $(cd "$(dirname "$0")"; pwd)/start_linux.sh