北斗定位
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dipper_position_run.sh 1.2KB

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. environment=$1
  3. version=$2
  4. echo "环境变量为${environment},版本为$version!"
  5. #processID='ps -ef | grep dipperposition | awk '{print $2}' | awk NR==1'
  6. ps -ef | grep dipperposition | awk '{print $2}' | xargs kill -9
  7. #echo $processID
  8. #if [[ "$processID" != "" ]]; then
  9. # kill -9 $processID
  10. #fi
  11. if [[ ${environment} == 'pro' ]]; then
  12. echo 'run in production environment'
  13. cd /home/data/dipperposition
  14. if [[ -f /home/linwl/dipperposition/dipperposition.jar ]]; then
  15. echo 'mv /home/linwl/dipperposition/dipperposition.jar to destination'
  16. mv /home/linwl/dipperposition/dipperposition.jar /home/data/dipperposition/dipperposition.jar
  17. fi
  18. nohup java -Xmx1024M -Xms1024M -Djava.security.egd=file:/dev/./urandom -Dio.netty.leakDetectionLevel=ADVANCED -jar dipperposition.jar --spring.profiles.active=pro &
  19. fi
  20. if [[ ${environment} == 'test' ]]; then
  21. cd /home/data/dipperposition
  22. if [[ -f /home/linwl/Work/DipperPosition/dipperposition.jar ]]; then
  23. mv /home/linwl/Work/DipperPosition/dipperposition.jar /home/data/dipperposition/dipperposition.jar
  24. fi
  25. nohup java -Xmx128M -Xms128M -Djava.security.egd=file:/dev/./urandom -Dio.netty.leakDetectionLevel=ADVANCED -jar dipperposition.jar --spring.profiles.active=test &
  26. fi