Alexander Schäferdiek
71977c9dca
All checks were successful
continuous-integration/drone/push Build is passing
13 lines
No EOL
465 B
Bash
Executable file
13 lines
No EOL
465 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
check_required() {
|
|
type hostname &> /dev/null || { echo "Requiring 'hostname' but it's not installed"; exit 1; }
|
|
type mailx &> /dev/null || { echo "Requiring 'mailx' but it's not installed"; exit 1; }
|
|
type wall &> /dev/null || { echo "Requiring 'wall' but it's not installed"; exit 1; }
|
|
}
|
|
|
|
check_required
|
|
|
|
HOSTNAME=$(hostname)
|
|
echo "$SMARTD_MESSAGE" | mail -s "[smartd $HOSTNAME] $SMARTD_FAILTYPE" "$SMARTD_ADDRESS"
|
|
wall "$SMARTD_MESSAGE" |