serverscripts/00logwatch
Matthew McKinnon 3f7512e6e9 Updated scripts for sendemail
Removed scipts no longer required
Updated README.md
2017-06-15 21:06:29 +10:00

20 lines
525 B
Bash
Executable File

#!/bin/bash
# Script Name: 00logwatch
# Author: Matt McKinnon
# Date: 7th June 2016
# Description:
# This script will email a logwatch report
MAILTO="support@comprofix.com"
MAILFROM="support@comprofix.com"
THISSERVER=$(hostname -f)
SMTP="mail.comprofix.com"
#Check if removed-but-not-purged
test -x /usr/share/logwatch/scripts/logwatch.pl || exit 0
#execute
/usr/sbin/logwatch > /tmp/logwatch
sendemail -o tls=no -s $SMTP -t $MAILTO -f "$THISSERVER <$MAILFROM>" -u "[$THISSERVER] Logwatch" -m "$(cat /tmp/logwatch)" -q