start.sh 633 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. RESOURCE_NAME=cesium_manage_jm.jar
  3. tpid=`ps -ef|grep $RESOURCE_NAME|grep -v grep|grep -v kill|awk '{print $2}'`
  4. if [ ${tpid} ]; then
  5. echo 'Stop Process...'
  6. kill -15 $tpid
  7. fi
  8. sleep 5
  9. tpid=`ps -ef|grep $RESOURCE_NAME|grep -v grep|grep -v kill|awk '{print $2}'`
  10. if [ ${tpid} ]; then
  11. echo 'Kill Process!'
  12. kill -9 $tpid
  13. else
  14. echo 'Stop Success!'
  15. fi
  16. tpid=`ps -ef|grep $RESOURCE_NAME|grep -v grep|grep -v kill|awk '{print $2}'`
  17. if [ ${tpid} ]; then
  18. echo 'App is running.'
  19. else
  20. echo 'App is NOT running.'
  21. fi
  22. rm -f tpid
  23. nohup java -jar ./$RESOURCE_NAME --spring.profiles.active=sit &
  24. echo $! > tpid
  25. echo Start Success!