|
@@ -78,13 +78,16 @@ if [ ! "$1" ]; then
|
78
|
78
|
fi
|
79
|
79
|
|
80
|
80
|
if [[ "$1" == "on" || "$1" == "On" || "$1" == "ON" ]]; then
|
|
81
|
+ if [ -f /var/lib/matrix/homeserver.yaml ]; then
|
|
82
|
+ sed -i 's|log_file:.*|log_file: /etc/matrix/homeserver.log|g' /var/lib/matrix/homeserver.yaml
|
|
83
|
+ if ! grep -q "#log_config:" /var/lib/matrix/homeserver.yaml; then
|
|
84
|
+ sed -i 's|log_config:|#log_config:|g' /var/lib/matrix/homeserver.yaml
|
|
85
|
+ fi
|
|
86
|
+ fi
|
81
|
87
|
if [ -f /etc/fail2ban/fail2ban.conf ]; then
|
82
|
88
|
sed -i 's|loglevel.*|loglevel = 3|g' /etc/fail2ban/fail2ban.conf
|
83
|
89
|
sed -i 's|logtarget.*|logtarget = /var/log/fail2ban.log|g' /etc/fail2ban/fail2ban.conf
|
84
|
90
|
fi
|
85
|
|
- if [ -f /var/lib/matrix/homeserver.yaml ]; then
|
86
|
|
- sed -i 's|log_file:.*|log_file: /var/lib/matrix/homeserver.log|g' /var/lib/matrix/homeserver.yaml
|
87
|
|
- fi
|
88
|
91
|
if [ -d /etc/tor ]; then
|
89
|
92
|
if [ ! -f /var/log/tor.log ]; then
|
90
|
93
|
touch /var/log/tor.log
|
|
@@ -148,6 +151,15 @@ if [[ "$1" == "on" || "$1" == "On" || "$1" == "ON" ]]; then
|
148
|
151
|
else
|
149
|
152
|
if [ -f /var/lib/matrix/homeserver.yaml ]; then
|
150
|
153
|
sed -i 's|log_file:.*|log_file: /dev/null|g' /var/lib/matrix/homeserver.yaml
|
|
154
|
+ if ! grep -q "#log_config:" /var/lib/matrix/homeserver.yaml; then
|
|
155
|
+ sed -i 's|log_config:|#log_config:|g' /var/lib/matrix/homeserver.yaml
|
|
156
|
+ fi
|
|
157
|
+ if [ -f /etc/matrix/homeserver.log ]; then
|
|
158
|
+ shred -zu /etc/matrix/homeserver.log
|
|
159
|
+ fi
|
|
160
|
+ if [ -f /etc/matrix/homeserver.log.1 ]; then
|
|
161
|
+ shred -zu /etc/matrix/homeserver.log.1
|
|
162
|
+ fi
|
151
|
163
|
fi
|
152
|
164
|
if [ -d /etc/tor ]; then
|
153
|
165
|
sed -i 's|#Log notice file.*|Log notice file /dev/null|g' /etc/tor/torrc
|
|
@@ -261,7 +273,7 @@ fi
|
261
|
273
|
if [ -d /etc/fail2ban ]; then
|
262
|
274
|
systemctl restart fail2ban
|
263
|
275
|
fi
|
264
|
|
-if [ -f /var/lib/matrix/homeserver.yaml ]; then
|
|
276
|
+if [ -d /etc/matrix ]; then
|
265
|
277
|
systemctl restart matrix
|
266
|
278
|
fi
|
267
|
279
|
|