Check whether any certificates exist via script.
This commit is contained in:
16
scripts/check_certificates.sh
Executable file
16
scripts/check_certificates.sh
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Set env variables
|
||||||
|
|
||||||
|
DOMAIN_DIR=$DOMAIN_DIR
|
||||||
|
CERT_DIR=$CERT_DIR
|
||||||
|
|
||||||
|
create_self_signed_certificate() {
|
||||||
|
# generate key
|
||||||
|
openssl req -x509 -newkey rsa:4096 -keyout $CERT_DIR/key.pem -out $CERT_DIR/cert.pem -days 365 -sha256 -nodes -subj '/CN=domain.tld'
|
||||||
|
|
||||||
|
# generate dhparam file
|
||||||
|
openssl dhparam -out $CERT_DIR/dhparam.pem 4096
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@@ -109,3 +109,11 @@ echo "location / {
|
|||||||
}"
|
}"
|
||||||
|
|
||||||
} >> "$file"
|
} >> "$file"
|
||||||
|
|
||||||
|
# check whether certificates exist or not
|
||||||
|
|
||||||
|
if [ $HTTPS_PORT != "" ]; then
|
||||||
|
./check_certificates.sh;
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user