#!/bin/bash
#Desc:项目停止脚本
#Author:xxxx
#version:1.0
#Create:2021-09-13
APP_NAME=api.jar
usage() {
echo "用法: sh sens.sh [start(启动)|stop(停止)|restart(重启)|status(状态)]"
exit 1
}
is_exist(){
pid=`ps -ef|grep $APP_NAME|grep -v grep|awk '{print $2}' `
if [ -z "${pid}" ]; then
return 1
else
return 0
fi
}
start(){
is_exist
if [ $? -eq "0" ]; then
echo "${APP_NAME} 正在运行。 pid=${pid} ."
else
nohup java -jar -server -Xms256m -Xmx512m -Xmn128m -XX:+UseConcMarkSweepGC -XX:CMSFullGCsBeforeCompaction=5 -XX:+UseCMSCompactAtFullCollection -XX:+PrintGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/heapdump.hprof -Dspring.profiles.active=prod "/home/proj/$APP_NA
Shell脚本启动项目案例
最新推荐文章于 2022-11-18 20:53:35 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)