The spring boot jar package executes a simple script to start and stop

start.sh:

\#!/bin/bash

PROJECTNAME=tcloud-cpsp-music

pid=`ps -ef |grep $PROJECTNAME |grep -v "grep" |awk '{print $2}'`

if [ $pid ]; then

	 echo "$PROJECTNAME  is  running  and pid=$pid"

else

	echo "Start success to start $PROJECTNAME ...."

nohup java -jar tcloud-cpsp-music-0.0.1-SNAPSHOT.jar  >> catalina.out  2>&1 &

be


stop.sh
\#!/bin/bash

PROJECTNAME=tcloud-cpsp-music

pid=`ps -ef |grep $PROJECTNAME |grep -v "grep" |awk '{print $2}' `

if [ $pid ]; then

	echo "$PROJECTNAME is  running  and pid=$pid"

	kill -9 $pid

	if [[ $? -eq 0 ]];then


		echo "sucess to stop $PROJECTNAME "

	else

		echo "fail to stop $PROJECTNAME "

	be

be

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326265983&siteId=291194637