1、killsvr.sh

#! /bin/bash

SVR_PATH=/opt/project

echo "kill procese begin"

echo "kill logstash"
ps -ef|grep logstash | grep -v grep | awk '{print $2}' | xargs kill -9


echo "kill procese end"

 

2、runsvr.sh

#! /bin/bash
SVR_PATH=/opt/svr_zway

uwsc=`ps -ef|grep sms-1.0.3-SNAPSHOT.jar|grep -v grep| wc -l| awk '{print $1}'`
if [ $uwsc -eq 0 ]
then
cd $SVR_PATH/sms
nohup java -jar -Xms2024m -Xmx2024m -Xmn1024m sms-1.0.3-SNAPSHOT.jar --spring.profiles.active=test >/dev/null 2>&1 &
sleep 10
echo sms is starting
else
echo -e "\033[31m sms has started \033[0m"
fi