Turing rsyslog on or off

This commit is contained in:
Bob Mottram 2017-08-05 22:23:52 +01:00
parent bd86c4b19a
commit 259e061dcf
3 changed files with 11 additions and 0 deletions

View File

@ -1295,6 +1295,8 @@ function reset_tripwire {
return
fi
clear
echo $'Turing off logging...'
${PROJECT_NAME}-logging off
echo $'Locking down permissions...'
lockdown_permissions
echo $'Creating configuration...'

View File

@ -83,6 +83,9 @@ function turn_logging_off {
}
function turn_off_rsys_logging {
if grep -q '/var/log/auth.log' /etc/rsyslog.conf; then
return
fi
sed -i 's|mail,news.none.*|mail,news.none /dev/null|g' /etc/rsyslog.conf
sed -i 's|auth,authpriv.\*.*|auth,authpriv.\* /dev/null|g' /etc/rsyslog.conf
sed -i 's|mail.info.*|mail.info /dev/null|g' /etc/rsyslog.conf
@ -106,6 +109,9 @@ function turn_off_rsys_logging {
}
function turn_on_rsys_logging {
if ! grep -q '/var/log/auth.log' /etc/rsyslog.conf; then
return
fi
sed -i 's|mail,news.none.*|mail,news.none -/var/log/messages|g' /etc/rsyslog.conf
sed -i 's|auth,authpriv.\*.*|auth,authpriv.\* /var/log/auth.log|g' /etc/rsyslog.conf
sed -i 's|mail.info.*|mail.info -/var/log/mail.info|g' /etc/rsyslog.conf

View File

@ -208,6 +208,9 @@ function install_backports_kernel {
}
function turn_off_rsys_logging {
if grep -q '/var/log/auth.log' /etc/rsyslog.conf; then
return
fi
sed -i 's|mail,news.none.*|mail,news.none /dev/null|g' /etc/rsyslog.conf
sed -i 's|auth,authpriv.\*.*|auth,authpriv.\* /dev/null|g' /etc/rsyslog.conf
sed -i 's|mail.info.*|mail.info /dev/null|g' /etc/rsyslog.conf