Browse Source

add smart status code

develop
Simon Vieille 2 months ago
parent
commit
28d7ee5336
Signed by: deblan GPG Key ID: 03383D15A1D31745
4 changed files with 7 additions and 2 deletions
  1. +4
    -0
      helpers/smart
  2. +1
    -0
      scripts/smart
  3. +1
    -1
      templates/deblan-text/smart.tpl
  4. +1
    -1
      templates/deblan/smart.tpl

+ 4
- 0
helpers/smart View File

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

+ 1
- 0
scripts/smart View File

@ -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


+ 1
- 1
templates/deblan-text/smart.tpl View File

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


+ 1
- 1
templates/deblan/smart.tpl View File

@ -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