From: Clinton Ebadi Date: Sat, 27 Dec 2014 23:39:37 +0000 (-0500) Subject: ca-install: use openssl instead of grepping for private key X-Git-Url: https://git.hcoop.net/hcoop/scripts.git/commitdiff_plain/53aedbcad439c4fe4e04bef17f46a91dc86fd391 ca-install: use openssl instead of grepping for private key The check was never reliable, do it the Right Way (tm) instead. --- diff --git a/ca-install b/ca-install index 3eb2d5c..c008d2b 100755 --- a/ca-install +++ b/ca-install @@ -102,7 +102,7 @@ fi echo # Determine whether we need to concatenate a private key -if grep "^-----BEGIN PRIVATE KEY-----" "$CERT" > /dev/null; then +if openssl rsa -noout -check -in "$CERT" > /dev/null; then KEY= else if test -z "$KEY"; then