1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/freshrss_ynh.git synced 2024-09-03 18:36:33 +02:00

while upgrading, create the logfile for fail2ban if it doesn't exist

This commit is contained in:
OniriCorpe 2023-11-01 05:31:14 +01:00
parent ced530d14f
commit bfe5b1fa45

View file

@ -105,6 +105,11 @@ ynh_use_logrotate --non-append
#=================================================
ynh_script_progression --message="Upgrading fail2ban configuration..."
# If it doesn't exist, create the logfile, required before configuring fail2ban
if [ ! -f "/var/log/${domain}-access.log" ]; then
touch "/var/log/${domain}-access.log"
fi
# Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="/var/log/${domain}-access.log" --failregex="<HOST> .* \"GET /api/.*\" 401" --max_retry=5