]>
Commit | Line | Data |
---|---|---|
d2e702cf GI |
1 | #! /bin/sh |
2 | ||
3 | # Send mail | |
ff28b140 TL |
4 | if which mail >/dev/null 2>&1 |
5 | then | |
6 | echo "$SMARTD_MESSAGE" | mail -s "$SMARTD_FAILTYPE" "$SMARTD_ADDRESS" | |
7 | fi | |
d2e702cf GI |
8 | |
9 | # Notify desktop user | |
ff28b140 TL |
10 | MESSAGE="SMART Disk monitor:" |
11 | case "$SMARTD_FAILTYPE" in | |
12 | "EmailTest"|"Health"|"Temperature"|"Usage") | |
13 | ;; | |
14 | *) | |
15 | # "CurrentPendingSector", // 10 | |
16 | # "OfflineUncorrectableSector", // 11 | |
17 | # "FailedReadSmartErrorLog", // 7 | |
18 | # "ErrorCount", // 4 | |
19 | # "FailedReadSmartData", // 6 | |
20 | # "FailedHealthCheck", // 5 | |
21 | # "FailedOpenDevice", // 9 | |
22 | # "SelfTest", // 3 | |
23 | # "FailedReadSmartSelfTestLog", // 8 | |
24 | exit 0 | |
25 | esac | |
d2e702cf GI |
26 | |
27 | # direct write to terminals, do not use 'wall', because we don't want its ugly header | |
28 | for t in $(who | awk '{ print $2; }' | grep -e '^tty' -e '^pts/') | |
29 | do | |
30 | echo "$MESSAGE | |
31 | $SMARTD_MESSAGE" >/dev/$t 2>/dev/null ||: | |
32 | done | |
33 |