Fixing variable issue

This commit is contained in:
2022-11-04 09:08:17 +00:00
parent 63d9f76cbb
commit e33c7c2d6a

View File

@@ -14,8 +14,8 @@ start_letsencrypt() {
/usr/local/bin/acme.sh -m $email --issue --standalone --keylength 4096 -d $DOMAIN --cert-file /acme.sh/$DOMAIN/cert.pem --key-file /acme.sh/$DOMAIN/key.pem --fullchain-file /acme.sh/$DOMAIN/fullchain.pem
# Check certificate issuer
ISSUER=$(openssl x509 -in /etc/ssl/keys/launchpad.staging.galaxis.xyz/fullchain.pem -text -noout |grep -w CN |grep Issuer | cut -d '=' -f2);
SUBJECT=$(openssl x509 -in /etc/ssl/keys/launchpad.staging.galaxis.xyz/fullchain.pem -text -noout |grep -w CN |grep Subject | cut -d '=' -f2);
ISSUER=$(openssl x509 -in /acme.sh/$DOMAIN/fullchain.pem -text -noout |grep -w CN |grep Issuer | cut -d '=' -f2);
SUBJECT=$(openssl x509 -in /acme.sh/$DOMAIN/fullchain.pem -text -noout |grep -w CN |grep Subject | cut -d '=' -f2);
if [ "$ISSUER" == "$SUBJECT" ]; then
echo "Self signed certificate found";
/usr/local/bin/acme.sh -m $email --force --issue --standalone --keylength 4096 -d $DOMAIN --cert-file /acme.sh/$DOMAIN/cert.pem --key-file /acme.sh/$DOMAIN/key.pem --fullchain-file /acme.sh/$DOMAIN/fullchain.pem