#!/bin/bash

PROJECT_JAR="examcloud-core-questions-starter-v4.1.0-SNAPSHOT.jar"

PROJECT_JVM_ARGS=`cat start.vmoptions`

PROJECT_ARGS=`cat start.args`

PROJECT_ARGS=$PROJECT_ARGS" --sys.config.center.secretKey="$1

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..."
