Use shell wildcard expansion now

This commit is contained in:
Jimver 2020-08-27 12:50:48 +02:00
parent 6f6e21add2
commit cd94da3449
No known key found for this signature in database
GPG Key ID: 24A793B2C1A18A05
1 changed files with 10 additions and 5 deletions

View File

@ -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