Skip to content

Commit

Permalink
make-certs: Handle missing OpenSSL installation
Browse files Browse the repository at this point in the history
If there is no OpenSSL installation on the system, where the
`make-certs` script is run at, no error message will be shown; instead
the script will fail silently and no certificates will be generated.

This change introduces a simple check, if the `openssl` binary is
present and informs the user, if it's missing, shortening debugging time
from minutes to mere seconds.

A bashism has been used so a pretty message gets printed without moving
the check to a section before `set -e`.

Signed-off-by: Kamil Aronowski <[email protected]>
  • Loading branch information
aronowski authored and vathpela committed Nov 12, 2024
1 parent e064e7d commit e68f4ca
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions make-certs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

set -e

if [[ ! -f `which openssl` ]]; then
echo "OpenSSL not found. Install it first, then run this script again."
exit 1
fi

DOMAIN=xn--u4h.net
DAYS=365
KEYTYPE=RSA
Expand Down

0 comments on commit e68f4ca

Please sign in to comment.