Handle fail2ban logging
This commit is contained in:
parent
23f40d14a1
commit
c62e88f29f
|
@ -40,6 +40,10 @@ if [ ! "$1" ]; then
|
|||
fi
|
||||
|
||||
if [[ "$1" == "on" || "$1" == "On" || "$1" == "ON" ]]; then
|
||||
if [ -f /etc/fail2ban/fail2ban.conf ]; then
|
||||
sed -i 's|loglevel.*|loglevel = 3|g' /etc/fail2ban/fail2ban.conf
|
||||
sed -i 's|logtarget.*|logtarget = /var/log/fail2ban.log|g' /etc/fail2ban/fail2ban.conf
|
||||
fi
|
||||
if [ -d /etc/tor ]; then
|
||||
sed -i 's|#Log notice file.*|Log notice file /var/log/tor.log|g' /etc/tor/torrc
|
||||
sed -i 's|Log notice file.*|Log notice file /var/log/tor.log|g' /etc/tor/torrc
|
||||
|
@ -149,6 +153,10 @@ else
|
|||
fi
|
||||
sed -i 's|log_error =.*|log_error = /dev/null|g' /etc/mysql/my.cnf
|
||||
fi
|
||||
if [ -f /etc/fail2ban/fail2ban.conf ]; then
|
||||
sed -i 's|loglevel.*|loglevel = 1|g' /etc/fail2ban/fail2ban.conf
|
||||
sed -i 's|logtarget.*|logtarget = /dev/null|g' /etc/fail2ban/fail2ban.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -d /etc/nginx ]; then
|
||||
|
@ -176,5 +184,8 @@ fi
|
|||
if [ -d /var/www/radicale ]; then
|
||||
systemctl restart radicale
|
||||
fi
|
||||
if [ -d /etc/fail2ban ]; then
|
||||
systemctl restart fail2ban
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Reference in New Issue