restart.sh 515 B

1234567891011121314
  1. #!/bin/bash
  2. jar_name=mldong-admin.jar
  3. jar_path=/java_projects/mldong-admin
  4. jar_pid=$(ps -ef | grep $jar_path/$jar_name | grep -v grep | awk '{print $2}')
  5. echo "$jar_name PID $jar_pid"
  6. if [ -n "$jar_pid" ]
  7. then
  8. #!kill -9 强制终止
  9. echo "kill -9 强制终止" $jar_pid
  10. kill -9 $jar_pid
  11. fi
  12. nohup java -server -Xms512m -Xmx512m -jar $jar_path/$jar_name --server.port=18081 --spring.profiles.active=test > $jar_path/nohub.out &
  13. echo "**********************$jar_name*************************"