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

restore: create file for fail2ban if not exist

This commit is contained in:
Gwen Lg 2023-11-25 13:48:36 +01:00
parent 546eddc15d
commit 09e0b5101e

View file

@ -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