diff --git a/scripts/restore b/scripts/restore index 39a0157..51865cf 100644 --- a/scripts/restore +++ b/scripts/restore @@ -71,6 +71,12 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= ynh_script_progression --message="Restoring fail2ban configuration..." +# If it doesn't exist, create the logfile, required before configuring fail2ban +log4fail2ban="/var/log/nginx/${domain}-access.log" +if [ ! -f "${log4fail2ban}" ]; then + touch "${log4fail2ban}" +fi + ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" ynh_systemd_action --action=restart --service_name=fail2ban