1 Star 0 Fork 16

裴永余 / WeBASE-Front

forked from WeBank / WeBASE-Front 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
status.sh 1.24 KB
一键复制 编辑 原始数据 按行查看 历史
v_sflkchen 提交于 2019-11-15 15:19 . support secp256k1
#!/bin/bash
APP_MAIN=com.webank.webase.front.Application
CURRENT_DIR=`pwd`
CONF_DIR=${CURRENT_DIR}/conf
SERVER_PORT=$(cat $CONF_DIR/application.yml| grep "port" | awk '{print $2}'| sed 's/\r//')
if [ ${SERVER_PORT}"" = "" ];then
echo "$CONF_DIR/application.yml server port has not been configured"
exit -1
fi
processPid=0
checkProcess(){
server_pid=`ps aux | grep java | grep $APP_MAIN | awk '{print $2}'`
port_pid=`netstat -anp 2>&1|grep ":$SERVER_PORT "|awk '{printf $7}'|cut -d/ -f1`
if [ -n "$port_pid" ]; then
if [[ $server_pid =~ $port_pid ]]; then
processPid=$port_pid
else
processPid=0
fi
else
processPid=0
fi
}
status(){
checkProcess
echo "==============================================================================================="
if [ $processPid -ne 0 ]; then
echo "Server $APP_MAIN Port $SERVER_PORT is running PID($processPid)"
echo "==============================================================================================="
else
echo "Server $APP_MAIN Port $SERVER_PORT is not running"
echo "==============================================================================================="
fi
}
status
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/magic-codex/WeBASE-Front.git
git@gitee.com:magic-codex/WeBASE-Front.git
magic-codex
WeBASE-Front
WeBASE-Front
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891