杀死启动进程

一、kill进程

#!/bin/bash
PID=$(ps -ef | grep seps-web-1.0-SNAPSHOT.jar | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
    echo Application is already stopped
else
    echo kill $PID
    kill $PID
fi

二、启动进程

#!/bin/bash
PID=$(ps -ef | grep hybrid-cloud-application.jar | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
    nohup java -Dsun.misc.URLClassPath.disableJarChecking=true -Dfile.encoding=UTF-8 -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9043 -jar hybrid-cloud-application.jar --spring.config.location=./application.properties &
else
    echo Application is already started
fi

 

posted @ 2020-08-11 16:04  小小仓鼠  阅读(204)  评论(0编辑  收藏  举报