serverscripts/00logwatch

21 lines
569 B
Plaintext
Raw Normal View History

2015-11-22 22:43:43 +10:00
#!/bin/bash
# Script Name: 00logwatch
# Author: Matt McKinnon
# Date: 7th June 2016
# Description:
# This script will email a logwatch report
2015-11-22 22:43:43 +10:00
MAILTO="support@comprofix.com"
THISSERVER=$(hostname -f)
2024-06-21 21:50:10 +10:00
MAILFROM="$THISSERVER@comprofix.com"
SMTP="comprofix-com.mail.protection.outlook.com"
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 > /tmp/logwatch
2015-11-22 22:43:43 +10:00
sendemail -o tls=no -s $SMTP -t $MAILTO -f "$THISSERVER <$MAILFROM>" -u "[$THISSERVER] Logwatch" -m "$(cat /tmp/logwatch)" -q
2024-06-21 21:50:10 +10:00
rm /tmp/logwatch