From f11e820d86317b1318de12b78e1afe423d73eef8 Mon Sep 17 00:00:00 2001 From: Natalie Date: Mon, 25 May 2026 16:09:15 -0700 Subject: [PATCH] =?UTF-8?q?fix(@scripts/session-tools):=20=F0=9F=90=9B=20i?= =?UTF-8?q?mprove=20nvme=20temp=20parsing=20and=20systemctl=20output?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- bin/apricot-doctor | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/apricot-doctor b/bin/apricot-doctor index b4f5510..0f8fea1 100755 --- a/bin/apricot-doctor +++ b/bin/apricot-doctor @@ -88,8 +88,12 @@ cmd_check() { echo "NVMe composite temps:" for dev in /dev/nvme?n1; do [ -e "$dev" ] || continue + # Match exactly the "temperature" line (not "temperature_sensor_*"), + # then take the first integer after the colon. t=$(sudo -n nvme smart-log "$dev" 2>/dev/null \ - | awk -F: '/^temperature/ {gsub(/[^0-9.]/,"",$2); print $2; exit}') + | grep -E '^temperature[[:space:]]*:' \ + | head -1 \ + | sed -E 's/.*:[[:space:]]*([0-9]+).*/\1/') printf ' %s %s°C\n' "$dev" "${t:-?}" done fi @@ -116,7 +120,9 @@ cmd_check() { ok "no failed units" else warn "$failed_count failed unit(s):" - systemctl --failed --no-pager --no-legend | awk '{print " " $1}' + # --no-legend output: "● unit-name loaded failed failed Description" + # The first column is the bullet glyph; the unit name is $2. + systemctl --failed --no-pager --no-legend | awk '{print " " $2}' fi }