aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xfiles/certreq.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/files/certreq.sh b/files/certreq.sh
index ea645ac..5093f5d 100755
--- a/files/certreq.sh
+++ b/files/certreq.sh
@@ -10,13 +10,14 @@
# 2017-11-22 Add ca cert chain
# 2018-04-16 Add --list and --csr options
# 2018-05-07 Add actions for using a CA with manually-approved certs
+# 2018-06-19 Fix get number of ca cert
# Usage: in ansible role certreq
# Microsoft CA cert templates have permissions on them. A user must be able to "enroll" on the template.
# Reference: ftemplate.sh 2017-10-10x; framework.sh 2017-10-09a
# fundamental curl statements https://stackoverflow.com/questions/31283476/submitting-base64-csr-to-a-microsoft-ca-via-curl/39722983#39722983
# Improve:
fiversion="2017-10-10x"
-certreqversion="2018-05-07a"
+certreqversion="2018-06-19a"
usage() {
less -F >&2 <<ENDUSAGE
@@ -209,7 +210,7 @@ get_number_of_current_ca_cert() {
-H "Referer: ${this_ca}/certsrv/certrqxt.asp" \
-H 'User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko' \
-H 'Content-Type: application/x-www-form-urlencoded' )"
- CURRENTNUM="$( echo "${RESPONSE}" | grep -cE 'Option' )"
+ CURRENTNUM="$( echo "${RESPONSE}" | grep -oE 'nRenewals=[0-9]+'| tr -dc '[0-9]' )"
}
bgstack15