|
@@ -137,7 +137,9 @@ if [[ "$1" == "on" || "$1" == "On" || "$1" == "ON" ]]; then
|
137
|
137
|
if [ ! -d /var/log/mysql ]; then
|
138
|
138
|
mkdir /var/log/mysql
|
139
|
139
|
fi
|
140
|
|
- sed -i 's|log_error =.*|log_error = /var/log/mysql/error.log|g' /etc/mysql/my.cnf
|
|
140
|
+ if [ -f /etc/mysql/my.cnf ]; then
|
|
141
|
+ sed -i 's|log_error =.*|log_error = /var/log/mysql/error.log|g' /etc/mysql/my.cnf
|
|
142
|
+ fi
|
141
|
143
|
fi
|
142
|
144
|
turn_on_rsys_logging
|
143
|
145
|
else
|
|
@@ -207,7 +209,9 @@ else
|
207
|
209
|
if [ -f /var/log/mysql.log ]; then
|
208
|
210
|
shred -zu /var/log/mysql.log
|
209
|
211
|
fi
|
210
|
|
- sed -i 's|log_error =.*|log_error = /dev/null|g' /etc/mysql/my.cnf
|
|
212
|
+ if [ -f /etc/mysql/my.cnf ]; then
|
|
213
|
+ sed -i 's|log_error =.*|log_error = /dev/null|g' /etc/mysql/my.cnf
|
|
214
|
+ fi
|
211
|
215
|
fi
|
212
|
216
|
if [ -f /etc/fail2ban/fail2ban.conf ]; then
|
213
|
217
|
sed -i 's|loglevel.*|loglevel = 1|g' /etc/fail2ban/fail2ban.conf
|