auto-sync: 2026-05-22 18:33:08

This commit is contained in:
cfdaily
2026-05-22 18:33:08 +08:00
parent a05dba3e8f
commit 20028d21d3
+4 -4
View File
@@ -40,10 +40,10 @@ fi
echo ""
if pm2 describe "$PM2_NAME" >/dev/null 2>&1; then
PM2_DESC=$(pm2 describe "$PM2_NAME" 2>/dev/null)
STATUS=$(echo "$PM2_DESC" | grep "status" | head -1 | sed 's/.*│ *//' | sed 's/ *│.*//')
PID=$(echo "$PM2_DESC" | grep -E "^\\│ pid " | head -1 | sed 's/.*│ *//' | sed 's/ *│.*//')
UPTIME=$(echo "$PM2_DESC" | grep "uptime" | head -1 | sed 's/.*│ *//' | sed 's/ *│.*//')
RESTARTS=$(echo "$PM2_DESC" | grep "restarts" | head -1 | sed 's/.*│ *//' | sed 's/ *│.*//')
STATUS=$(echo "$PM2_DESC" | grep "status" | head -1 | perl -pe 's/.*?\s+(\S+)\s*$/\1/')
PID=$(echo "$PM2_DESC" | grep -E "pid " | head -1 | perl -pe 's/.*?\s+(\d+)\s*$/\1/')
UPTIME=$(echo "$PM2_DESC" | grep "uptime" | head -1 | perl -pe 's/^.*\x{2502}\s*//; s/\s*$//')
RESTARTS=$(echo "$PM2_DESC" | grep "restarts" | head -1 | perl -pe 's/^.*\x{2502}\s*//; s/\s*$//')
if [ "$STATUS" = "online" ]; then
echo " PM2: online ✅"