Skip to content
Snippets Groups Projects
Commit d6cf0997 authored by Bob Mottram's avatar Bob Mottram
Browse files

Turn matrix logging on or off

parent a289ba98
No related branches found
No related tags found
No related merge requests found
...@@ -82,6 +82,9 @@ if [[ "$1" == "on" || "$1" == "On" || "$1" == "ON" ]]; then ...@@ -82,6 +82,9 @@ if [[ "$1" == "on" || "$1" == "On" || "$1" == "ON" ]]; then
sed -i 's|loglevel.*|loglevel = 3|g' /etc/fail2ban/fail2ban.conf 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 sed -i 's|logtarget.*|logtarget = /var/log/fail2ban.log|g' /etc/fail2ban/fail2ban.conf
fi fi
if [ -f /var/lib/matrix/homeserver.yaml ]; then
sed -i 's|log_file:.*|log_file: /var/lib/matrix/homeserver.log|g' /var/lib/matrix/homeserver.yaml
fi
if [ -d /etc/tor ]; then if [ -d /etc/tor ]; then
if [ ! -f /var/log/tor.log ]; then if [ ! -f /var/log/tor.log ]; then
touch /var/log/tor.log touch /var/log/tor.log
...@@ -143,6 +146,9 @@ if [[ "$1" == "on" || "$1" == "On" || "$1" == "ON" ]]; then ...@@ -143,6 +146,9 @@ if [[ "$1" == "on" || "$1" == "On" || "$1" == "ON" ]]; then
fi fi
turn_on_rsys_logging turn_on_rsys_logging
else else
if [ -f /var/lib/matrix/homeserver.yaml ]; then
sed -i 's|log_file:.*|log_file: /dev/null|g' /var/lib/matrix/homeserver.yaml
fi
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
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
...@@ -255,5 +261,8 @@ fi ...@@ -255,5 +261,8 @@ fi
if [ -d /etc/fail2ban ]; then if [ -d /etc/fail2ban ]; then
systemctl restart fail2ban systemctl restart fail2ban
fi fi
if [ -f /var/lib/matrix/homeserver.yaml ]; then
systemctl restart matrix
fi
exit 0 exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment