From 20028d21d37bf0c7fe341ab5a7b0d0f24a50a6aa Mon Sep 17 00:00:00 2001 From: cfdaily Date: Fri, 22 May 2026 18:33:08 +0800 Subject: [PATCH] auto-sync: 2026-05-22 18:33:08 --- scripts/status.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/status.sh b/scripts/status.sh index b64782c..36db030 100755 --- a/scripts/status.sh +++ b/scripts/status.sh @@ -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 ✅"