启动项目进程脚本

64人浏览 / 0人评论
#!/bin/bash
APP_JAR="/release/es1-1.0-SNAPSHOT.jar"
MEM="2g"
PIDS=`ps -f | grep java | grep "$APP_JAR" |awk '{print $2}'`
if [ -n "$PIDS" ]; then
    echo "ERROR: The $APP_JAR already started!"
    echo "PID: $PIDS"
    exit 1
fi

JAVA_MEM_OPTS=" -server -Xms"${MEM}" -Xmx"${MEM}" -XX:+UseParallelGC "
echo ${JAVA_MEM_OPTS}
java   $JAVA_MEM_OPTS   -jar $APP_JAR $1 --spring.profiles.active=test &
echo "程序启动中。。。"

 

全部评论