From d17d30d6a7c7b208f731309d05cdcd9bf9eaacb0 Mon Sep 17 00:00:00 2001 From: Kristian Schuster Date: Thu, 26 Sep 2019 21:24:15 +0200 Subject: nginx-test: add log file detection for relative paths --- include/functions | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include/functions') diff --git a/include/functions b/include/functions index 89626958..b96bb070 100644 --- a/include/functions +++ b/include/functions @@ -2181,8 +2181,9 @@ if [ ! "${VALUE}" = "" ]; then # If multiple values follow, select first one VALUE=$(echo ${VALUE} | awk '{ print $1 }') - if [ ! -f ${VALUE} ]; then - LogText "Result: could not find referenced log file ${VALUE} in nginx configuration" + # Find both, log files provided with full or relative path + if [ ! -f ${VALUE} -a ! -f "${CONFIG_FILE%nginx.conf}${VALUE}" ]; then + LogText "Result: could not find log file ${VALUE} referenced in nginx configuration" NGINX_ACCESS_LOG_MISSING=1 fi fi @@ -2218,7 +2219,8 @@ # Check if log file exists FILE=$(echo ${VALUE} | awk '{ print $1 }') if [ ! "${FILE}" = "" ]; then - if [ ! -f ${FILE} ]; then + # Find both, log files provided with full or relative path + if [ ! -f ${FILE} -a ! -f "${CONFIG_FILE%nginx.conf}${FILE}" ]; then NGINX_ERROR_LOG_MISSING=1 fi else -- cgit v1.2.3