diff options
author | Jimver <jim.verheijde@hotmail.com> | 2020-08-27 13:50:48 +0300 |
---|---|---|
committer | Jimver <jim.verheijde@hotmail.com> | 2020-08-27 13:50:48 +0300 |
commit | cd94da34492ff18eb83b9f2dae89e8e68866ca3d (patch) | |
tree | ad3f889b5d543044ef92204d3faf9127f628d5f7 /include/functions | |
parent | 6f6e21add230ae1bc156ea2de23eac9e45a6eec3 (diff) |
Use shell wildcard expansion now
Diffstat (limited to 'include/functions')
-rw-r--r-- | include/functions | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/include/functions b/include/functions index 60e213be..b88a7261 100644 --- a/include/functions +++ b/include/functions @@ -2310,15 +2310,20 @@ # Check if path is absolute or relative case $VALUE in /*) - # Absolute path, so list files directly from that path - CONF_LS=$(${LSBINARY} ${VALUE%;*} 2>/dev/null) # Will error if wildcard doesn't match anything, so pipe stderr to /dev/null + # Absolute path, so wildcard pattern is already correct + CONF_WILDCARD=${VALUE%;*} ;; *) - # Relative path, so construct absolute path first to list files for - CONF_LS=$(${LSBINARY} ${CONFIG_FILE%nginx.conf}${VALUE%;*} 2>/dev/null) + # Relative path, so construct absolute path for wildcard pattern + CONF_WILDCARD=${CONFIG_FILE%nginx.conf}${VALUE%;*} ;; esac - for FOUND_CONF in CONF_LS; do + for FOUND_CONF in ${CONF_WILDCARD}; do + if [ "${FOUND_CONF}" = "${CONF_WILDCARD}" ]; then + + LogText "Found no match for ${CONF_WILDCARD}" + break + fi 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 |