From c10cab9219155ff51915a934d05541d7863b5ff4 Mon Sep 17 00:00:00 2001 From: Gwen Lg <105106246+gwen-lg@users.noreply.github.com> Date: Thu, 28 Dec 2023 12:46:03 +0100 Subject: [PATCH] Add check of set and not null var log4fail2ban suggestions from @ericgaspar Co-authored-by: eric_G <46165813+ericgaspar@users.noreply.github.com> --- scripts/restore | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index 2a5534a..ffc6870 100644 --- a/scripts/restore +++ b/scripts/restore @@ -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 diff --git a/scripts/upgrade b/scripts/upgrade index c96c558..ad8ddd4 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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