update server/src/main/bin/startup.sh.

获取pid时过滤grep进程本身并且筛选java程序(避免showlog影响,showlog也有kkFilePreview关键字),避免取到的pid不是真实的程序pid导致shutdown失败。


Signed-off-by: stevenwmq <stevenwmq@163.com>
This commit is contained in:
stevenwmq 2024-01-30 08:31:29 +00:00 committed by Gitee
parent bef81a940e
commit 7d17dae1fd
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ else
echo "You can get help in our official home site: https://kkview.cn"
echo "If you need further help, please join our kk opensource community: https://t.zsxq.com/09ZHSXbsQ"
echo "If this project is helpful to you, please star it on https://gitee.com/kekingcn/file-online-preview/stargazers"
PROCESS=$(ps -ef | grep kkFileView | awk 'NR==1{print $2}')
PROCESS=$(ps -ef | grep -v grep | grep java | grep kkFileView | awk 'NR==1{print $2}')
# 启动成功后将进程号写入pid文件
echo "$PROCESS" > "$PID_FILE"
fi