build / build (push) Successful in 38m26s
- das-shell 0.1.0: the Das two-line bash prompt by default (replaces the PS1 of Void's skel .bashrc once), dprompt (Textual prompt builder with presets and live preview) and dbanner (SSH login banner editor: canvas tools, fields with values, widgets, das-banner service for cached ones, Das OS logo and tryzub pictures). Python tests in make test. - das-server 0.3.0 depends on das-shell; the server installer mentions dprompt and dbanner; the desktop image includes it. - run-qemu.sh forwards the guest's SSH to localhost:2222. - Hardware fixes: Ventoy menu icon, boot menu titles "Das OS <version>". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
1.3 KiB
Bash
Executable File
28 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# dbanner-title-uk: Стан дисків (SMART)
|
|
# dbanner-title-en: Disk health (SMART)
|
|
# dbanner-mode: cached
|
|
# dbanner-interval: 21600
|
|
# Health, temperature and power-on hours of every disk; needs root and smartmontools.
|
|
. "${0%/*}/lib.sh"
|
|
command -v smartctl >/dev/null || exit 0
|
|
((EUID == 0)) || exit 0
|
|
first=1
|
|
for dev in /sys/block/*; do
|
|
name=${dev##*/}
|
|
[[ $name == @(loop|ram|zram|sr|dm-|md)* ]] && continue
|
|
out=$(smartctl -H -A -i "/dev/$name" 2>/dev/null) || [[ -n $out ]] || continue
|
|
model=$(sed -n 's/^\(Device Model\|Model Number\|Product\): *//p' <<<"$out" | head -1)
|
|
health=$(sed -n 's/.*\(overall-health\|Health Status\).*: *//p' <<<"$out" | head -1)
|
|
temp=$(awk '/Temperature_Celsius|Airflow_Temperature/ {print $10; exit} /^Temperature:/ {print $2; exit}' <<<"$out")
|
|
hours=$(awk '/Power_On_Hours/ {print $10; exit} /^Power On Hours:/ {gsub(",", "", $4); print $4; exit}' <<<"$out")
|
|
[[ -n $health ]] || continue
|
|
if ((first)); then echo "$Bold$(say "Стан дисків:" "Disk health:")$Off"; first=0; fi
|
|
hcolor=$Green
|
|
[[ $health == PASSED || $health == OK ]] || hcolor=$Red
|
|
line=" /dev/$name ${model:+($model) }$hcolor$health$Off"
|
|
[[ $temp =~ ^[0-9]+$ ]] && line+=", $(level "$temp" 55 70)$temp °C$Off"
|
|
[[ $hours =~ ^[0-9]+$ ]] && line+=", $Cyan$hours $(say "год" "h")$Off"
|
|
echo "$line"
|
|
done
|