Add files via upload

This commit is contained in:
2019-03-28 13:35:54 +03:00
committed by GitHub
commit e8ebfe59c5
8 changed files with 168 additions and 0 deletions

19
30-hdd-temp Normal file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
sd=(sda sdb sdc sdd)
out=""
clear="\e[0m\e[39m"
my_target_temp=45
for i in ${!sd[@]}; do
temp=$(hddtemp -nq /dev/${sd[$i]} 2> /dev/null)
color="\e[42m"
if [ "$temp" -ge "${my_target_temp}" ]; then
color="\e[41m"
fi
out+="${sd[$i]} \e[30m $color $temp $clear ,"
c=i+1
done
out+="\n"
echo -e "
HDD Temps:"
printf "$out" | column -c $c -ts $',' | sed -e 's/^/ /'