diff --git a/src/freedombone-logging b/src/freedombone-logging index 6c57fca3..8b732ab9 100755 --- a/src/freedombone-logging +++ b/src/freedombone-logging @@ -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