From de18ddc2c01b2d53a21d48c8497a7a08a7386bf0 Mon Sep 17 00:00:00 2001 From: Kepi Date: Thu, 2 Jul 2020 22:14:38 +0200 Subject: [functions] ParseNginx: Support include on absolute paths Includes can be absolute paths too. This is quick fix counting on fact that absolute paths have slash at start. --- include/functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/functions') diff --git a/include/functions b/include/functions index 4ff5b43a..39ae7c92 100644 --- a/include/functions +++ b/include/functions @@ -2305,7 +2305,8 @@ # Check for additional config files included as follows # "include sites-enabled/*.conf" elif [ $(echo ${VALUE} | grep -F -c "*.conf") -gt 0 ]; then - for FOUND_CONF in $(ls ${CONFIG_FILE%nginx.conf}${VALUE%;*}); do + if [ "$(echo ${VALUE} | ${CUTBINARY} -c1)" != "/" ]; then VALUE=${CONFIG_FILE%nginx.conf}; fi + for FOUND_CONF in $(ls ${VALUE%;*}); do FOUND=0 for CONF in ${NGINX_CONF_FILES}; do if [ "${CONF}" = "${FOUND_CONF}" ]; then FOUND=1; LogText "Found this file already in our configuration files array, not adding to queue"; fi -- cgit v1.2.3 From a2e752a8db56032e38cc8c7b96830ceea90bf844 Mon Sep 17 00:00:00 2001 From: Kepi Date: Thu, 2 Jul 2020 22:22:34 +0200 Subject: [functions] ParseNginx: Ignore empty included wildcards Its ok to have empty directories included. We should not output errors with lsbinary unable to find anything there. --- include/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/functions') diff --git a/include/functions b/include/functions index 39ae7c92..36113531 100644 --- a/include/functions +++ b/include/functions @@ -2306,7 +2306,7 @@ # "include sites-enabled/*.conf" elif [ $(echo ${VALUE} | grep -F -c "*.conf") -gt 0 ]; then if [ "$(echo ${VALUE} | ${CUTBINARY} -c1)" != "/" ]; then VALUE=${CONFIG_FILE%nginx.conf}; fi - for FOUND_CONF in $(ls ${VALUE%;*}); do + for FOUND_CONF in $(ls ${VALUE%;*} 2> /dev/null); do FOUND=0 for CONF in ${NGINX_CONF_FILES}; do if [ "${CONF}" = "${FOUND_CONF}" ]; then FOUND=1; LogText "Found this file already in our configuration files array, not adding to queue"; fi -- cgit v1.2.3 From 3124a04ce9ace5a9bc650a70aac940b3bcacac9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Wed, 21 Oct 2020 11:27:44 +0200 Subject: require pgrep before usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Sjögren --- include/functions | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include/functions') diff --git a/include/functions b/include/functions index 8cd95aec..6964da20 100644 --- a/include/functions +++ b/include/functions @@ -1547,8 +1547,7 @@ if [ -z "${search}" ]; then ExitFatal "Missing process to search for when using IsRunning function"; fi RUNNING=0 - # AIX does not fully support pgrep options, so using ps instead - if [ "${OS}" != "AIX" ]; then + if [ -x "${PGREPBINARY}" ] && [ "${OS}" != "AIX" ]; then # When --user is used, perform a search using the -u option # Initialize users for strict mode if [ -n "${users:-}" ]; then -- cgit v1.2.3