summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <erich.eckner.ext@bestsecret.com>2023-07-07 09:19:16 +0200
committerErich Eckner <erich.eckner.ext@bestsecret.com>2023-07-07 09:19:16 +0200
commit047117b7f6cf4227b14c394d9de9c398cb424392 (patch)
tree5f8e61593d5c86099004772266169ddb711b2645
parent5d23ed49d9c41b013a8f93ed09ab68483b48f037 (diff)
downloadcrypt-expiry-check-047117b7f6cf4227b14c394d9de9c398cb424392.tar.xz
calculate MIN_DATE only once
-rwxr-xr-xcrypt-expiry-check.in3
1 files changed, 1 insertions, 2 deletions
diff --git a/crypt-expiry-check.in b/crypt-expiry-check.in
index f81a9fd..3c0a79b 100755
--- a/crypt-expiry-check.in
+++ b/crypt-expiry-check.in
@@ -125,9 +125,9 @@ set_retcode()
#####################################################################
prints()
{
+ MIN_DATE=$(echo $4 | ${AWK} '{ print $1, $2, $4 }')
if ${ISSUER} && ! ${VALIDATION}
then
- MIN_DATE=$(echo $4 | ${AWK} '{ print $1, $2, $4 }')
if ${NAGIOS}
then
${PRINTF} "%-35s %-17s %-8s %-11s %-4s %-30s\n" "$1:$2" "$6" "$3" "${MIN_DATE}" \|days="$5"
@@ -140,7 +140,6 @@ prints()
elif ! ${VALIDATION}
then
- MIN_DATE=$(echo $4 | ${AWK} '{ print $1, $2, $4 }')
if ${NAGIOS}
then
${PRINTF} "%-47s %-12s %-12s %-4s %-30s\n" "$1:$2" "$3" "${MIN_DATE}" \|days="$5"