summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2022-02-06 21:57:46 +0100
committerErich Eckner <git@eckner.net>2022-02-06 21:57:46 +0100
commita0fa9b3ba474952242951af06b0d1feb23f080a0 (patch)
treef57c2d4f49f8b74ed3cd5d8c88ba40deb618e1f7
parent1d4e5f2607ec48b88f39a208d05e440ac8ab061d (diff)
downloadcrypt-expiry-check-a0fa9b3ba474952242951af06b0d1feb23f080a0.tar.xz
crypt-expiry-check.in: do not hide exit code by pipe
-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'
+ )
}
#####################################################