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

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

Go to download

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

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

#=====================================================================
# 查看应用服务是否启动或停止状态的 shell 脚本
# 通过项目名称查找到 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} 服务. [not running!]"
    exit 0;
fi

echo "\${APPLICATION} 服务正在运行中 (PID: \${pid}). [is running ...]"




© 2015 - 2024 Weber Informatics LLC | Privacy Policy