Browse Source

add smart status code

develop
Simon Vieille 6 months ago
parent
commit
28d7ee5336
Signed by: deblan GPG Key ID: 03383D15A1D31745
  1. 4
      helpers/smart
  2. 1
      scripts/smart
  3. 2
      templates/deblan-text/smart.tpl
  4. 2
      templates/deblan/smart.tpl

4
helpers/smart

@ -4,3 +4,7 @@ get_smart() {
smartctl -H "$1"
}
get_smart_status() {
smartctl -H "$1" 2>/dev/null >/dev/null
echo $?
}

1
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

2
templates/deblan-text/smart.tpl

@ -1,4 +1,4 @@
S.M.A.R.T ${device}
S.M.A.R.T ${device} (status: ${status})
------------------------
${result}

2
templates/deblan/smart.tpl

@ -1,5 +1,5 @@
<div class="title">
S.M.A.R.T ${device}
S.M.A.R.T ${device} (status: ${status})
</div>
<div class="content">

Loading…
Cancel
Save