Update start.sh

木子李·De 3 years ago
parent 37b39a740f
commit 7ac6847f1c

@ -1,4 +1,8 @@
#!/bin/bash
#判断java是否存在
command -v java >/dev/null 2>&1 || { echo >&2 "require java but it's not installed. Aborting."; sleep 5;exit 1; }
cd `dirname $0`
BIN_DIR=`pwd` #安装目录
cd ..
@ -7,13 +11,7 @@ LIB_DIR=$DEPLOY_DIR/lib #jar目录
CONF_DIR=$DEPLOY_DIR/conf #conf目录
LOGS_DIR=$DEPLOY_DIR/logs #log目录
LIB_JARS=`ls $LIB_DIR|grep -v aj-report*.jar|awk '{print "'$LIB_DIR'/"$0}'|tr "\n" ":"`
JAVA_OPTS=" -server -Xmx2g -Xms2g -Xmn256m -XX:PermSize=128m -Xss256k "
echo "$DEPLOY_DIR"
echo "$LIB_JARS"
LIB_JARS=`ls $LIB_DIR|grep -v aj-report|awk '{print "'$LIB_DIR'/"$0}'|tr "\n" ":"`
PIDS=`ps -f | grep java | grep "aj-report" |awk '{print $2}'`
if [ -n "$PIDS" ]; then
@ -22,7 +20,7 @@ if [ -n "$PIDS" ]; then
exit 1
fi
JAVA_OPTS=" -server -Xmx2g -Xms2g -Xmn256m -XX:PermSize=128m -Xss256k "
nohup java $JAVA_OPTS -Xbootclasspath/a:$LIB_JARS -jar -Dspring.config.location=$CONF_DIR/bootstrap.yml $LIB_DIR/aj-report-*.jar >/dev/null 2>&1 &
echo "The AJ-Report started!"
Loading…
Cancel
Save