2015-11-22 22:43:43 +10:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
MAILTO="support@comprofix.com"
|
|
|
|
SMTP=mail.comprofix.com
|
|
|
|
THISSERVER=`hostname --fqdn`
|
2016-03-26 21:59:06 +10:00
|
|
|
MAILFROM="$(hostname)@$(dnsdomainname)"
|
2015-11-22 22:43:43 +10:00
|
|
|
|
|
|
|
#Check if removed-but-not-purged
|
|
|
|
test -x /usr/share/logwatch/scripts/logwatch.pl || exit 0
|
|
|
|
|
|
|
|
#execute
|
|
|
|
#/usr/sbin/logwatch --output mail
|
|
|
|
/usr/sbin/logwatch
|
|
|
|
|
2016-03-26 21:59:06 +10:00
|
|
|
sendemail -o tls=no -s $SMTP -t $MAILTO -f "$THISSERVER <$MAILFROM>" -u "[$THISSERVER] Logwatch" -m "$(cat /tmp/logwatch)" -q
|
2015-11-22 22:43:43 +10:00
|
|
|
|
|
|
|
#Note: It's possible to force the recipient in above command
|
|
|
|
#Just pass --mailto address@a.com instead of --output mail
|