Handle rsyslog
This commit is contained in:
parent
d1ff074551
commit
41f5a8cd5b
|
@ -95,6 +95,14 @@ if [[ "$1" == "on" || "$1" == "On" || "$1" == "ON" ]]; then
|
||||||
fi
|
fi
|
||||||
sed -i 's|log_error =.*|log_error = /var/log/mysql/error.log|g' /etc/mysql/my.cnf
|
sed -i 's|log_error =.*|log_error = /var/log/mysql/error.log|g' /etc/mysql/my.cnf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
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
|
||||||
|
sed -i 's|mail.warn.*|mail.warn -/var/log/mail.warn|g' /etc/rsyslog.conf
|
||||||
|
sed -i 's|mail.err.*|mail.err /var/log/mail.err|g' /etc/rsyslog.conf
|
||||||
|
sed -i 's|daemon.\*.*|daemon.\* -/var/log/daemon.log|g' /etc/rsyslog.conf
|
||||||
|
sed -i 's|mail.\*.*|mail.\* -/var/log/mail.log|g' /etc/rsyslog.conf
|
||||||
|
sed -i 's|user.\*.*|user.\* -/var/log/user.log|g' /etc/rsyslog.conf
|
||||||
else
|
else
|
||||||
if [ -d /etc/tor ]; then
|
if [ -d /etc/tor ]; then
|
||||||
sed -i 's|#Log notice file.*|Log notice file /dev/null|g' /etc/tor/torrc
|
sed -i 's|#Log notice file.*|Log notice file /dev/null|g' /etc/tor/torrc
|
||||||
|
@ -166,8 +174,21 @@ else
|
||||||
sed -i 's|logtarget.*|logtarget = /dev/null|g' /etc/fail2ban/fail2ban.conf
|
sed -i 's|logtarget.*|logtarget = /dev/null|g' /etc/fail2ban/fail2ban.conf
|
||||||
shred -zu /var/log/fail2ban.*
|
shred -zu /var/log/fail2ban.*
|
||||||
fi
|
fi
|
||||||
|
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
|
||||||
|
sed -i 's|mail.warn.*|mail.warn /dev/null|g' /etc/rsyslog.conf
|
||||||
|
sed -i 's|mail.err.*|mail.err /dev/null|g' /etc/rsyslog.conf
|
||||||
|
sed -i 's|daemon.\*.*|daemon.\* /dev/null|g' /etc/rsyslog.conf
|
||||||
|
sed -i 's|mail.\*.*|mail.\* /dev/null|g' /etc/rsyslog.conf
|
||||||
|
sed -i 's|user.\*.*|user.\* /dev/null|g' /etc/rsyslog.conf
|
||||||
|
shred -zu /var/log/auth.*
|
||||||
|
shred -zu /var/log/mail.*
|
||||||
|
shred -zu /var/log/daemon.*
|
||||||
|
shred -zu /var/log/user.*
|
||||||
|
shred -zu /var/log/messages*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
systemctl restart syslog
|
||||||
if [ -d /etc/nginx ]; then
|
if [ -d /etc/nginx ]; then
|
||||||
systemctl restart php5-fpm
|
systemctl restart php5-fpm
|
||||||
systemctl restart nginx
|
systemctl restart nginx
|
||||||
|
|
Loading…
Reference in New Issue