diff --git a/helpers/smart b/helpers/smart index 95e23c0..e998cc7 100644 --- a/helpers/smart +++ b/helpers/smart @@ -4,3 +4,7 @@ get_smart() { smartctl -H "$1" } +get_smart_status() { + smartctl -H "$1" 2>/dev/null >/dev/null + echo $? +} diff --git a/scripts/smart b/scripts/smart index 2a7c839..f2bbc23 100755 --- a/scripts/smart +++ b/scripts/smart @@ -6,6 +6,7 @@ for device in $SMART_DEVICES; do export device export result="$(get_smart "$device")" + export status="$(get_smart_status "$device")" render_template smart done diff --git a/templates/deblan-text/smart.tpl b/templates/deblan-text/smart.tpl index df9b37d..875ae9f 100644 --- a/templates/deblan-text/smart.tpl +++ b/templates/deblan-text/smart.tpl @@ -1,4 +1,4 @@ -S.M.A.R.T ${device} +S.M.A.R.T ${device} (status: ${status}) ------------------------ ${result} diff --git a/templates/deblan/smart.tpl b/templates/deblan/smart.tpl index 0288e47..912a8e3 100644 --- a/templates/deblan/smart.tpl +++ b/templates/deblan/smart.tpl @@ -1,5 +1,5 @@
- S.M.A.R.T ${device} + S.M.A.R.T ${device} (status: ${status})