Fix PM2 log file path and add existence checks

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-11-08 17:21:08 +00:00
parent 7d2a570924
commit f33d5e8cdf

View File

@ -24,10 +24,18 @@ copy_dep() {
pm2_log() { pm2_log() {
echo -e "---> pm2日志" echo -e "---> pm2日志"
local panelOut="/root/.pm2/logs/panel-out.log" local panelOut="/root/.pm2/logs/qinglong-out.log"
local panelError="/root/.pm2/logs/panel-error.log" local panelError="/root/.pm2/logs/qinglong-error.log"
tail -n 300 "$panelOut" if [[ -f "$panelOut" ]]; then
tail -n 300 "$panelError" tail -n 300 "$panelOut"
else
echo "日志文件不存在: $panelOut"
fi
if [[ -f "$panelError" ]]; then
tail -n 300 "$panelError"
else
echo "日志文件不存在: $panelError"
fi
} }
check_ql() { check_ql() {