homeserver/roles/mgrote.smart/templates/smart_status.sh
mg e4e84d2218 templates: Header-Var eingefügt (#22)
python zu 3

rest

zfs

Postfix

Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: mg/ansible#22
Co-Authored-By: mg <mg@noreply.git.mgrote.net>
Co-Committed-By: mg <mg@noreply.git.mgrote.net>
2021-03-07 19:40:32 +01:00

6 lines
417 B
Bash

#!/bin/bash
{{ file_header | default () }}
for i in {a..z}; do
smartctl /dev/sd$i -a | grep "Device Model: "
smartctl /dev/sd$i -a | grep "SMART overall-health self-assessment test result: " | sed -r 's/SMART overall-health self-assessment test result: /SMART test result: /g'| sed -r "s/(PASSED)/`printf "\033[92m"`\1`printf "\033[0m"`/g" | sed -r "s/(FAILED)/`printf "\033[31m"`\1`printf "\033[0m"`/g"
done