Created
November 3, 2012 09:14
-
-
Save asimzeeshan/4006677 to your computer and use it in GitHub Desktop.
Installs and configures logwatch (debian based systems)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install and configure logwatch | |
# | |
# Tested on Ubuntu 12.04 | |
# Tested on Virtualization type: OpenVZ, KVM, XEN-PV | |
# | |
# By: Asim Zeeshan | |
# http://www.asim.pk/ | |
# | |
# Helpful hints from | |
# http://stackoverflow.com/questions/5955548/how-do-i-use-sed-to-change-my-configuration-files-with-flexible-keys-and-values/5955591#5955591 | |
# | |
# ----------------------------------------------------- | |
# INSTALL LOGWATCH ON DEBIAN BASED SYSTEMS | |
# ----------------------------------------------------- | |
apt-get clean all | |
apt-get update && apt-get -q -y upgrade | |
apt-get install -q -y logwatch | |
# ----------------------------------------------------- | |
# CONFIGURE Logwatch via bash/perl | |
# | |
# IMPORTANT: Change my@email.com to your own email address | |
# ----------------------------------------------------- | |
sed -i -e '/Output =/ s/= .*/= mail/' /usr/share/logwatch/default.conf/logwatch.conf | |
sed -i -e '/MailTo =/ s/= .*/= my@email.com/' /usr/share/logwatch/default.conf/logwatch.conf | |
sed -i -e '/Detail =/ s/= .*/= Med/' /usr/share/logwatch/default.conf/logwatch.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment