linux按服务名停止服务脚本-shutdown.sh
#!/bin/bash
PID=$(ps -ef | grep test-service.jar | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
echo Application is already stopped
else
echo kill $PID
kill -9 $PID
fi
#!/bin/bash
PID=$(ps -ef | grep test-service.jar | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
echo Application is already stopped
else
echo kill $PID
kill -9 $PID
fi