#!/bin/bash

/usr/sbin/hddtemp /dev/sda > /tmp/.temp;

drive=`awk '{ print $4 }' /tmp/.temp | sed "s/[^0-9]//g"`;

if [ $drive -gt 37 ]

  then ( echo "The temperature is `awk '{ print $4 }' /tmp/.temp`. " | mail -s "$(uname -n): Temperature Alert" chrisbinnie@domain.com)

  else exit

fi

