summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcrypt-expiry-check.in29
1 files changed, 15 insertions, 14 deletions
diff --git a/crypt-expiry-check.in b/crypt-expiry-check.in
index 60bbd24..5734051 100755
--- a/crypt-expiry-check.in
+++ b/crypt-expiry-check.in
@@ -340,19 +340,7 @@ check_nginx_configuration() {
CONFIGDIR=${1}
FWARNDAYS=${2:-${WARNDAYS}}
- find "${CONFIGDIR}" \
- \( -type f -o -type l \) \
- -exec sed '
- s/#.*$//
- s/^\s*//
- s/\s*$//
- ' {} \; \
- | tr -d '\n' \
- | sed '
- s/}server\s*{/\n\0/g
- ' \
- | grep -wF 'ssl_certificate' \
- | while read -r line; do
+ while read -r line; do
{
read -r _ HOST _
read -r _ FILE
@@ -370,7 +358,20 @@ check_nginx_configuration() {
'
)
check_file_status "${FILE}" 'NGINX' "${HOST// /, }" "${WARNDAYS}"
- done
+ done < <(
+ find "${CONFIGDIR}" \
+ \( -type f -o -type l \) \
+ -exec sed '
+ s/#.*$//
+ s/^\s*//
+ s/\s*$//
+ ' {} \; \
+ | tr -d '\n' \
+ | sed '
+ s/}server\s*{/\n\0/g
+ ' \
+ | grep -wF 'ssl_certificate'
+ )
}
#####################################################