#! /bin/sh # Send mail if which mail >/dev/null 2>&1 then echo "$SMARTD_MESSAGE" | mail -s "$SMARTD_FAILTYPE" "$SMARTD_ADDRESS" fi # Notify desktop user MESSAGE="WARNING: Your hard drive is failing" # direct write to terminals, do not use 'wall', because we don't want its ugly header for t in $(who | awk '{ print $2; }' | grep -e '^tty' -e '^pts/') do echo "$MESSAGE $SMARTD_MESSAGE" >/dev/$t 2>/dev/null ||: done