diff options
author | Simon Rettberg | 2019-12-13 12:35:49 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-12-13 12:35:49 +0100 |
commit | e74418844e9912f254deb35eb7f60243e7af238b (patch) | |
tree | ad1a3940429f31673e4533ec87a65d1394bf2857 /core/modules/hardware-stats | |
parent | chroot.inc: fix broken || (diff) | |
download | mltk-e74418844e9912f254deb35eb7f60243e7af238b.tar.gz mltk-e74418844e9912f254deb35eb7f60243e7af238b.tar.xz mltk-e74418844e9912f254deb35eb7f60243e7af238b.zip |
[hardware-stats] Add NVMe support
Diffstat (limited to 'core/modules/hardware-stats')
-rwxr-xr-x | core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats | 6 |
1 files 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 |