#!/bin/bash
jarName=forwe-bp.jar
pid=$(ps -ef | grep ${jarName} | grep -v grep | awk '{ print $2 }')
if [[ ! -z "$pid" ]];
then
    echo -e "\033[31m服务运行中\033[0m"
    exit 1 
fi  


cd `dirname $0`
if [[ ! -d "./logs" ]]; then
mkdir "./logs"
fi

java -Xms512m -Xmx2048m  -jar   ${jarName}  --spring.profiles.active=prod --server.port=10087 --topic.name=BURYING_POINT_RECORD_1  $1 >> ./logs/log.txt 2>&1 &
java -Xms512m -Xmx2048m  -jar   ${jarName}  --spring.profiles.active=prod --server.port=10088 --topic.name=BURYING_POINT_RECORD_2  $1 >> ./logs/log2.txt 2>&1 &

if [[ $? -ne 0 ]]; then
    echo -e "\033[31m启动失败\033[0m"
else
    echo -e "\033[32m启动成功\033[0m"
fi
