1 Star 0 Fork 21

longamu/WeBASE-Node-Manager

forked from WeBank/WeBASE-Node-Manager 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
stop.sh 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
CodingCattwo 提交于 2020-04-26 17:30 . optimize sh
#!/bin/bash
APP_MAIN=com.webank.webase.node.mgr.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 $CURRENT_DIR | grep $APP_MAIN | awk '{print $2}')
if [ -n "$server_pid" ]; then
processPid=$server_pid
else
processPid=0
fi
}
stop(){
checkProcess
echo "==============================================================================================="
if [ $processPid -ne 0 ]; then
echo -n "Stopping Server $APP_MAIN Port $SERVER_PORT PID($processPid)..."
kill -9 $processPid
if [ $? -eq 0 ]; then
echo "[Success]"
echo "==============================================================================================="
else
echo "[Failed]"
echo "==============================================================================================="
fi
else
echo "Server $APP_MAIN Port $SERVER_PORT is not running"
echo "==============================================================================================="
fi
}
stop
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/longamu/WeBASE-Node-Manager.git
git@gitee.com:longamu/WeBASE-Node-Manager.git
longamu
WeBASE-Node-Manager
WeBASE-Node-Manager
master

搜索帮助