summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Aronowski <kamil.aronowski@yahoo.com>2023-08-01 15:01:34 +0200
committerPeter Jones <pjones@redhat.com>2024-11-12 17:08:00 -0500
commite68f4caade95faa9949d91751f4660c738ea52ac (patch)
tree4b86b4da95cc867545c7e8ebce416a26d99dc31d
parente064e7d2bfd834282f41ff9623d48abb1d1ae021 (diff)
downloadefi-boot-shim-e68f4caade95faa9949d91751f4660c738ea52ac.tar.gz
efi-boot-shim-e68f4caade95faa9949d91751f4660c738ea52ac.zip
make-certs: Handle missing OpenSSL installation
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 <kamil.aronowski@yahoo.com>
-rwxr-xr-xmake-certs5
1 files changed, 5 insertions, 0 deletions
diff --git a/make-certs b/make-certs
index 6f40b234..e2d3e4b4 100755
--- a/make-certs
+++ b/make-certs
@@ -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