]> git.proxmox.com Git - mirror_smartmontools-debian.git/blame - examplescripts/Example6
Enhance dh_clean to clean up better
[mirror_smartmontools-debian.git] / examplescripts / Example6
CommitLineData
d2e702cf
GI
1#! /bin/sh
2
3# Send mail
4echo "$SMARTD_MESSAGE" | mail -s "$SMARTD_FAILTYPE" "$SMARTD_ADDRESS"
5
6# Notify desktop user
7MESSAGE="WARNING: Your hard drive is failing"
8
9# direct write to terminals, do not use 'wall', because we don't want its ugly header
10for t in $(who | awk '{ print $2; }' | grep -e '^tty' -e '^pts/')
11do
12 echo "$MESSAGE
13$SMARTD_MESSAGE" >/dev/$t 2>/dev/null ||:
14done
15