Skip to content

Commit fa1ff60

Browse files
committed
fix: confirm in cert.sh before creating if cert exists
1 parent 58b821d commit fa1ff60

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scripts/cert.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,17 @@ eval $(egrep '^CERT_PATH' .env | xargs)
77
echo "Domain: ${HOST}"
88
echo "Cert Path: ${CERT_PATH}"
99

10-
echo "Creating Cert"
10+
if [ -f certs/cert.crt ] || [ -f certs/cert.key ] || [ -f certs/cert.pem ]; then
11+
echo -e "cert already exists in certs directory\nDo you want to overwrite the files? [y]es/[n]o"
12+
read -r ANSWER
13+
echo
14+
if [[ "$ANSWER" =~ ^[Yy](es)?$ ]] ; then
15+
echo "Creating Cert"
16+
else
17+
exit 1
18+
fi
19+
fi
20+
1121
./scripts/requests.sh
1222

1323
openssl genrsa -out $CERT_PATH/cert.key

0 commit comments

Comments
 (0)