Skip to content

Commit

Permalink
fix: confirm in cert.sh before creating if cert exists
Browse files Browse the repository at this point in the history
  • Loading branch information
abmruman committed Mar 25, 2020
1 parent 58b821d commit fa1ff60
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/cert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ eval $(egrep '^CERT_PATH' .env | xargs)
echo "Domain: ${HOST}"
echo "Cert Path: ${CERT_PATH}"

echo "Creating Cert"
if [ -f certs/cert.crt ] || [ -f certs/cert.key ] || [ -f certs/cert.pem ]; then
echo -e "cert already exists in certs directory\nDo you want to overwrite the files? [y]es/[n]o"
read -r ANSWER
echo
if [[ "$ANSWER" =~ ^[Yy](es)?$ ]] ; then
echo "Creating Cert"
else
exit 1
fi
fi

./scripts/requests.sh

openssl genrsa -out $CERT_PATH/cert.key
Expand Down

0 comments on commit fa1ff60

Please sign in to comment.