aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcertexpirecheck.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/certexpirecheck.sh b/certexpirecheck.sh
index 003e972..3f4f1ce 100755
--- a/certexpirecheck.sh
+++ b/certexpirecheck.sh
@@ -1,7 +1,7 @@
#!/bin/bash
domainexpiredate() {
- openssl x509 -text -in <(echo -n | openssl s_client -connect $1:$2 2>/dev/null | sed -n '/-*BEGIN/,/-*END/p') 2>/dev/null | sed -n 's/ *Not After : *//p'
+ openssl x509 -text -in <(echo -n | openssl s_client -connect $1:$2 2>/dev/null | awk 'BEGIN { showcrt = 0 } /-*BEGIN CERTIFICATE-*/ { showcrt = 1 } /-*END CERTIFICATE-*/ { print ; showcrt = 0 } { if (showcrt == 1) { print } }') 2>/dev/null | sed -n 's/ *Not After : *//p'
}
daysleft() {