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

Add check of set and not null var log4fail2ban

suggestions from @ericgaspar

Co-authored-by: eric_G <46165813+ericgaspar@users.noreply.github.com>
This commit is contained in:
Gwen Lg 2023-12-28 12:46:03 +01:00 committed by GitHub
parent 644fb9df4b
commit c10cab9219
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -74,7 +74,7 @@ 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"
ynh_restore_file --origin_path="${log4fail2ban}"
if [ ! -f "${log4fail2ban}" ]; then
if [ ! -f "${log4fail2ban:-}" ]; then
touch "${log4fail2ban}"
fi

View file

@ -107,7 +107,7 @@ ynh_script_progression --message="Upgrading 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
if [ ! -f "${log4fail2ban:-}" ]; then
touch "${log4fail2ban}"
fi