Browse Source

测试脚本-应用名称

wuweihao 3 years ago
parent
commit
02a429264c
1 changed files with 3 additions and 2 deletions
  1. 3 2
      startJar.sh

+ 3 - 2
startJar.sh

@@ -1,4 +1,5 @@
 APP_NAME=age_convert.jar
+APP_PORT=8003    #应用端口
 date=`date`
 usage() {
     echo "case: sh run.sh [start|stop|restart|status|checkServer]"
@@ -45,7 +46,7 @@ start(){
     if [ $? -eq "0" ]; then    # [$? -eq "0"] 说明pid不等于空 说明服务正在运行中,将进程号打印出来
         echo "${APP_NAME} running. pid=${pid}"
     else
-        nohup java -jar -Xmx3072M -Xms512M $APP_NAME --spring.profiles.active=$1  > logs.log 2>error.log &  # 说明pid为空
+        nohup java -jar -Xmx3072M -Xms512M ./$APP_NAME --spring.profiles.active=$1 --server.port=$APP_PORT  > logs.log 2>error.log &  # 说明pid为空
         # 执行java -jar 命令启动服务
         echo "${APP_NAME} started启动"
     fi
@@ -107,7 +108,7 @@ restart(){
         if [ $? -eq "0" ]; then    # [$? -eq "0"] 说明pid不等于空 说明服务正在运行中,将进程号打印出来
             echo "${APP_NAME} running. pid=${pid}"
         else
-            nohup java -jar -Xmx3072M -Xms512M $APP_NAME --spring.profiles.active=$1  > logs.log 2>error.log &  # 说明pid为空 执行java -jar 命令启动服务
+            nohup java -jar -Xmx3072M -Xms512M ./$APP_NAME --spring.profiles.active=$1 --server.port=$APP_PORT > logs.log 2>error.log &  # 说明pid为空 执行java -jar 命令启动服务
             echo "${APP_NAME} started启动"
         fi
 }