#!/bin/sh
name="ruoyi-admin.jar"
count=`ps -ef | grep $name | grep -v "grep" | wc -l`
if [[ $count == 0 ]];then
echo "$name未运行"
else
echo "$name已运行"
ps -ef|grep $name |grep -v grep|awk '{printf $2}'|xargs kill -9
fi
if [ ! -e nohup.out ];then
echo "nohup.out不存在"
touch nohup.out
else
echo "nohup.out存在"
> ./nohup.out
fi
nohup java -jar $name > ./nohup.out 2>&1 &
echo "$name 已启动"
echo "查看日志输入 tail -f nohup.out"
springboot项目启动脚本
于 2022-09-09 13:40:56 首次发布