summaryrefslogtreecommitdiff
path: root/temp_hdd
blob: 250c34c75ef2acc041c0b2e1b6f16e799c9d8595 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/zsh

. /home/pks/bin/func.zsh
check_root

MAX_TEMP=$1

for i in `ls -1 /dev/disk/by-id/ | grep -v -P "^wwn-|\-part\d$|md-name|md-uuid"`; do
  DRIVE="/dev/disk/by-id/$i"
  TEMP=$(/usr/sbin/hddtemp -n $DRIVE 2>/dev/null)
  if [ "$TEMP" != "" ]; then
    if [ $TEMP -gt $MAX_TEMP ]; then logger "$DRIVE temp at $TEMP"; fi
  fi
done