#!/bin/bash

PROJECT_JAR=`find . -name "examcloud-core-questions-starter*.jar"`
PROJECT_JAR=${PROJECT_JAR:6}

PROJECT_ARGS=`cat start.args`
PROJECT_ARGS=$PROJECT_ARGS" --sys.config.center.secretKey="$1

PROJECT_JVM_ARGS=`cat start.vmoptions`

PID_LIST=`ps -ef | grep $PROJECT_JAR | grep java | awk '{print $2}'`
if [ ! -z "$PID_LIST" ]; then
    echo "$PROJECT_JAR is already running..."
    #exit -1
fi

nohup java $PROJECT_JVM_ARGS -jar lib/$PROJECT_JAR $PROJECT_ARGS >/dev/null 2>&1 &

echo "$PROJECT_JAR start..."
