All Downloads are FREE. Search and download functionalities are using the official Maven repository.

linux.bin.stop.sh Maven / Gradle / Ivy

Go to download

这是一个用于对 SpringBoot 服务打包为 Windows、Linux 下可部署包的 Maven 插件。

There is a newer version: 1.5.5
Show newest version
#! /bin/bash

#=====================================================================
# 应用服务停止的 shell 脚本
# 通过项目名称查找到PID
# 然后 kill -9 pid
#=====================================================================

# 项目名称
APPLICATION="${name}"

if [[ -z "$1" ]]
then
    pid=`ps ax |grep -i '${jarName}' |grep java | grep -v grep |  awk '{print $1}'`
else
    pid=`ps ax |grep -i '${jarName}' |grep java | grep -i 'server.port='''${1}''''| grep -v grep |  awk '{print $1}'`
fi

if [[ -z "$pid" ]] ; then
    echo "\${APPLICATION} 服务并没有运行."
    exit 0;
fi

kill -9 \${pid}
echo "已成功关闭了 \${APPLICATION} 服务 (PID: \${pid})."




© 2015 - 2025 Weber Informatics LLC | Privacy Policy