From f2e656176e1b7df302caa7f2f3a8f01cc3dc4b77 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Mon, 13 Mar 2017 23:29:47 +0100 Subject: [PATCH] Failed if $1 not set Because we use set -u, this helper failed if the optional arg is not set --- data/helpers.d/backend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/helpers.d/backend b/data/helpers.d/backend index efc180d90..d6754bbfa 100644 --- a/data/helpers.d/backend +++ b/data/helpers.d/backend @@ -10,7 +10,7 @@ # # It's possible to use this helper several times, each config will added to same logrotate config file. ynh_use_logrotate () { - if [ -n "$1" ]; then + if [ "$#" -gt 0 ]; then if [ "$(echo ${1##*.})" == "log" ]; then # Keep only the extension to check if it's a logfile logfile=$1 # In this case, focus logrotate on the logfile else