From 176b619c2d4da90d200b550c64516ab4042bff26 Mon Sep 17 00:00:00 2001 From: Liran Tal Date: Mon, 1 Dec 2014 09:47:51 +0200 Subject: [PATCH] updating ssl generation script to check app root directory location as safe-guard --- scripts/generate-ssl-certs.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/generate-ssl-certs.sh b/scripts/generate-ssl-certs.sh index c77082d19a..5caaaa9a98 100644 --- a/scripts/generate-ssl-certs.sh +++ b/scripts/generate-ssl-certs.sh @@ -1,4 +1,13 @@ #!/bin/bash + +if [ ! -e server.js ] +then + echo "Error: could not find main application server.js file" + echo "You should run the generate-ssl-certs.sh script from the main MEAN application root directory" + echo "i.e: bash scripts/generate-ssl-cers.sh" + exit -1 +fi + echo "Generating self-signed certificates..." mkdir -p ./config/sslcerts openssl genrsa -out ./config/sslcerts/key.pem -aes256 1024