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

Check that file exists

parent 9176ac12
No related branches found
No related tags found
No related merge requests found
......@@ -137,7 +137,9 @@ if [[ "$1" == "on" || "$1" == "On" || "$1" == "ON" ]]; then
if [ ! -d /var/log/mysql ]; then
mkdir /var/log/mysql
fi
sed -i 's|log_error =.*|log_error = /var/log/mysql/error.log|g' /etc/mysql/my.cnf
if [ -f /etc/mysql/my.cnf ]; then
sed -i 's|log_error =.*|log_error = /var/log/mysql/error.log|g' /etc/mysql/my.cnf
fi
fi
turn_on_rsys_logging
else
......@@ -207,7 +209,9 @@ else
if [ -f /var/log/mysql.log ]; then
shred -zu /var/log/mysql.log
fi
sed -i 's|log_error =.*|log_error = /dev/null|g' /etc/mysql/my.cnf
if [ -f /etc/mysql/my.cnf ]; then
sed -i 's|log_error =.*|log_error = /dev/null|g' /etc/mysql/my.cnf
fi
fi
if [ -f /etc/fail2ban/fail2ban.conf ]; then
sed -i 's|loglevel.*|loglevel = 1|g' /etc/fail2ban/fail2ban.conf
......
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