From dac19a3cf1970f8f71d332054fe2cc72d0332c78 Mon Sep 17 00:00:00 2001 From: DJ Lucas Date: Fri, 25 Nov 2022 11:17:50 -0600 Subject: [PATCH] make-ca: Keep upstream formatting and remove Opnessl data --- make-ca | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/make-ca b/make-ca index 33485a9..2dc8c7c 100644 --- a/make-ca +++ b/make-ca @@ -696,9 +696,12 @@ if test "${GET}" == "1"; then echo -n "Downloading certdata.txt..." echo GET ${URL} | \ ${OPENSSL} s_client ${SARGS} 2> /dev/null >> "${CERTDATA}" - _line=$(( $(grep -n "certdata.txt" "${CERTDATA}" | cut -d ":" -f 1) - 1)) + _line=$(( $(grep -n -m 1 "^#$" "${CERTDATA}" | cut -d ":" -f 1) - 1)) sed -e "1,${_line}d" -i "${CERTDATA}" sed "1i # Revision:${REVISION}" -i "${CERTDATA}" + mv "${CERTDATA}" "${CERTDATA}.tmp" + head -n -33 "${CERTDATA}.tmp" > "${CERTDATA}" + rm "${CERTDATA}.tmp" echo "done." fi