From e74418844e9912f254deb35eb7f60243e7af238b Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 13 Dec 2019 12:35:49 +0100 Subject: [hardware-stats] Add NVMe support --- .../hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats index 6b81d7be..2a3c04f8 100755 --- a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats +++ b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats @@ -56,7 +56,7 @@ slxfdisk() { for binary in "/opt/openslx/sbin/fdisk -u" "busybox fdisk -u" "fdisk"; do $binary "$@" RET=$? - [ "$RET" = "127" ] && continue # command not found + mart "$RET" = "127" ] && continue # command not found [ "$RET" = "1" ] && [ "${binary%% *}" = "busybox" ] && continue # maybe applet not found return $RET done @@ -206,10 +206,10 @@ if which smartctl; then FILE=$(mktemp) [ -z "$FILE" ] && FILE="/tmp/smartctl.$$.$RANDOM.$RANDOM" for dev in "${DISKS[@]}"; do - smartctl -i -H -A -f "brief" "$dev" > "$FILE" + smartctl -i -H -A -f "brief" "${dev%n[0-9]}" > "$FILE" # Exit code might be nonzero to indicate fail status, or because some (but not all) ATA commands # failed. So instead, see if we at least got basic device information and go on if so. - grep -q -E -e '^Device Model:' -e '^\s*5\s.+\s.+\s.+\s[0-9]' "$FILE" || continue + grep -q -E -e '^Device Model:' -e '^\s*5\s.+\s.+\s.+\s[0-9]' -e '^Model Number:' "$FILE" || continue echo "NEXTHDD=$dev" >> "$ALLSMART" cat "$FILE" >> "$ALLSMART" # parse -- cgit v1.2.3-55-g7522