
adminName=huimv-farm-admin-0.0.1-SNAPSHOT-execute.jar
adminLogName=admin_log.log
current_time=$(date  +'%Y-%m-%d-%H:%M:%S')

adminNumber=`ps -ef |grep -w $adminName |grep -v grep|wc -l`
if [ $adminNumber -le 0 ];then
   echo "The "$adminName" is not run":
   curPath=$(readlink -f "$(dirname "$0")")
   cd $curPath

   nohup java -jar $adminName   -Xms256m -Xmx256m -Xmn96m > $curPath/$adminLogName  2>&1 &
   echo $current_time" The "$adminName" is starting..."
else
   echo $current_time" The "$adminName" is running..."
fi



envName=huimv-farm-environ-0.0.1-SNAPSHOT-execute.jar
envLogName=env_log.log
current_time=$(date  +'%Y-%m-%d-%H:%M:%S')

envNumber=`ps -ef |grep -w $envName |grep -v grep|wc -l`
if [ $envNumber -le 0 ];then
   echo "The "$envName" is not run":
   curPath=$(readlink -f "$(dirname "$0")")
   cd $curPath

   nohup java -jar $envName  -Xms256m -Xmx256m -Xmn96m   > $curPath/$envLogName  2>&1 &
   echo $current_time" The "$envName" is starting..."
else
   echo $current_time" The "$envName" is running..."
fi



gatewayName=huimv-farm-gateway-2.4.1.jar
gatewayLogName=gateway_log.log
current_time=$(date  +'%Y-%m-%d-%H:%M:%S')

gatewayNumber=`ps -ef |grep -w $gatewayName |grep -v grep|wc -l`
if [ $gatewayNumber -le 0 ];then
   echo "The "$gatewayName" is not run"
   curPath=$(readlink -f "$(dirname "$0")")
   cd $curPath

   nohup java -jar  $gatewayName  -Xms256m -Xmx256m -Xmn96m > $curPath/$gatewayLogName  2>&1 &
   echo $current_time" The "$gatewayName" is starting..."
   
else
   echo $current_time" The "$gatewayName" is running..."
fi




produceName=huimv-farm-produce-0.0.1-SNAPSHOT-execute.jar
produceLogName=produce_log.log
current_time=$(date  +'%Y-%m-%d-%H:%M:%S')

produceNumber=`ps -ef |grep -w $produceName |grep -v grep|wc -l`
if [ $produceNumber -le 0 ];then
   echo "The "$produceName" is not run"
   curPath=$(readlink -f "$(dirname "$0")")
   cd $curPath

   nohup java  -jar $produceName -Xms256m -Xmx256m -Xmn96m  > $curPath/$produceLogName  2>&1 &
   echo $current_time" The "$produceName" is starting..."
else
   echo $current_time" The "$produceName" is running..."
fi




videoName=huimv-farm-video-0.0.1-SNAPSHOT-execute.jar
videoLogName=video_log.log
current_time=$(date  +'%Y-%m-%d-%H:%M:%S')

videoNumber=`ps -ef |grep -w $videoName |grep -v grep|wc -l`
if [ $videoNumber -le 0 ];then
   echo "The "$videoName" is not run"
   curPath=$(readlink -f "$(dirname "$0")")
   cd $curPath

   nohup java  -jar $videoName -Xms256m -Xmx256m -Xmn96m  > $curPath/$videoLogName  2>&1 &
   echo $current_time" The "$videoName" is starting..."
else
   echo $current_time" The "$videoName" is running..."
fi











