2015-11-22 22:43:43 +10:00
|
|
|
#!/bin/bash
|
2016-06-07 20:42:19 +10:00
|
|
|
# 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
|
|
|
|
2017-04-04 23:49:53 +10:00
|
|
|
MAIL="support@comprofix.com"
|
|
|
|
O365_SMTP=$(grep SMTP office365.conf | awk -F'=' '{print $2}')
|
|
|
|
O365_USER=$(grep USER office365.conf | awk -F'=' '{print $2}')
|
|
|
|
O365_PASS=$(grep PASS office365.conf | awk -F'=' '{print $2}')
|
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
|
2016-06-07 20:42:19 +10:00
|
|
|
/usr/sbin/logwatch > /tmp/logwatch
|
2015-11-22 22:43:43 +10:00
|
|
|
|
2017-04-04 23:49:53 +10:00
|
|
|
sendemail -o tls=auto -s "$O365_SMTP" -xu "$O365_USER" -xp "$O365_PASS" -t "$MAIL" -f "$MAIL" -u "[$THISSERVER] Logwatch" -m "$(cat /tmp/logwatch)" -q
|