2011-02-17 16:04:48 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
# Send mail
|
2015-01-14 09:28:29 +00:00
|
|
|
if which mail >/dev/null 2>&1
|
|
|
|
then
|
2019-04-03 11:39:00 +00:00
|
|
|
echo "$SMARTD_FULLMESSAGE" | mail -s "$SMARTD_SUBJECT" "$SMARTD_ADDRESS"
|
2015-01-14 09:28:29 +00:00
|
|
|
fi
|
2011-02-17 16:04:48 +00:00
|
|
|
|
|
|
|
# Notify desktop user
|
2017-06-22 15:14:31 +00:00
|
|
|
MESSAGE="SMART Disk monitor:"
|
|
|
|
case "$SMARTD_FAILTYPE" in
|
|
|
|
"EmailTest"|"Health"|"Temperature"|"Usage")
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# "CurrentPendingSector", // 10
|
|
|
|
# "OfflineUncorrectableSector", // 11
|
|
|
|
# "FailedReadSmartErrorLog", // 7
|
|
|
|
# "ErrorCount", // 4
|
|
|
|
# "FailedReadSmartData", // 6
|
|
|
|
# "FailedHealthCheck", // 5
|
|
|
|
# "FailedOpenDevice", // 9
|
|
|
|
# "SelfTest", // 3
|
|
|
|
# "FailedReadSmartSelfTestLog", // 8
|
|
|
|
exit 0
|
|
|
|
esac
|
2011-05-16 13:38:58 +00:00
|
|
|
|
2021-06-16 10:08:17 +00:00
|
|
|
echo "$MESSAGE
|
|
|
|
$SMARTD_MESSAGE" | wall -n 2>/dev/null ||:
|
2011-02-17 16:14:06 +00:00
|
|
|
|