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