From a0fa9b3ba474952242951af06b0d1feb23f080a0 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sun, 6 Feb 2022 21:57:46 +0100 Subject: crypt-expiry-check.in: do not hide exit code by pipe --- crypt-expiry-check.in | 29 +++++++++++++++-------------- 1 file 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' + ) } ##################################################### -- cgit v1.2.3-54-g00ecf