2011-02-17 16:04:48 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
# Send mail
|
|
|
|
echo "$SMARTD_MESSAGE" | mail -s "$SMARTD_FAILTYPE" "$SMARTD_ADDRESS"
|
|
|
|
|
|
|
|
# Notify desktop user
|
2011-05-16 13:38:58 +00:00
|
|
|
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
|
2011-02-17 16:14:06 +00:00
|
|
|
|