2019-01-25 17:28:29 +00:00
|
|
|
#!/usr/bin/env bash
|
2023-01-25 01:16:01 +00:00
|
|
|
|
2023-01-25 08:42:22 +00:00
|
|
|
check_required() {
|
|
|
|
type hostname &> /dev/null || { echo "Requiring 'hostname' but it's not installed"; exit 1; }
|
|
|
|
type wall &> /dev/null || { echo "Requiring 'wall' but it's not installed"; exit 1; }
|
|
|
|
}
|
|
|
|
|
|
|
|
check_required
|
|
|
|
|
2019-01-25 17:28:29 +00:00
|
|
|
HOSTNAME=$(hostname)
|
2023-01-25 23:21:49 +00:00
|
|
|
|
|
|
|
SUBJECT="[smartd $HOSTNAME] $SMARTD_FAILTYPE"
|
|
|
|
MESSAGE=$(echo -e "$SMARTD_MESSAGE")
|
|
|
|
notifier "${SUBJECT}" "${MESSAGE}"
|
2019-01-25 17:28:29 +00:00
|
|
|
wall "$SMARTD_MESSAGE"
|