2023-02-01 10:37:18 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
cd $PWD
|
2023-02-21 17:36:11 +08:00
|
|
|
pid=$(ps -ef | grep lc_oa.jar | grep -v grep | awk '{print $2}')
|
2023-02-01 10:37:18 +08:00
|
|
|
if [ -n "$pid" ]; then
|
|
|
|
kill -9 $pid
|
|
|
|
fi
|
|
|
|
|
|
|
|
# 优化JVM参数
|
|
|
|
JAVA_OPTS="$MAVEN_OPTS -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m"
|
|
|
|
|
|
|
|
# 方式一、配置外部自定义的属性文件(建议)
|
|
|
|
#JAVA_OPTS="$JAVA_OPTS -Dspring.config.location=$PWD\application.yml"
|
|
|
|
|
|
|
|
# 方式二、配置环境名称,加载不同的属性文件
|
|
|
|
# JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=prod"
|
|
|
|
|
|
|
|
if [ -z "$JAVA_HOME" ]; then
|
|
|
|
RUN_JAVA=java
|
|
|
|
else
|
|
|
|
RUN_JAVA="$JAVA_HOME"/bin/java
|
|
|
|
fi
|
|
|
|
|
|
|
|
# 根据情况修改 web.war 为您的 war 包名称
|
2023-02-21 17:36:11 +08:00
|
|
|
nohup $RUN_JAVA $JAVA_OPTS -jar lc_oa.jar > system.log 2>&1 &
|
2023-02-01 10:37:18 +08:00
|
|
|
|
|
|
|
sleep 1
|
2023-02-21 17:36:11 +08:00
|
|
|
pid=$(ps -ef | grep lc_oa.jar | grep -v grep | awk '{print $2}')
|
2023-02-01 10:37:18 +08:00
|
|
|
echo $pid
|