-
-
Save progress44/5e9573399dfb4c3736c5e1ce6d97e8e5 to your computer and use it in GitHub Desktop.
SSL Renewal with LE using same CSR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CONTAINER="/var/www/html" | |
DOMAIN="kopiro.it" | |
PUBLIC_DIR="$CONTAINER/public" | |
BACKUP_DIR="$CONTAINER/conf/backup/$(date +%s)" | |
mkdir -p "$BACKUP_DIR" | |
cp -v $CONTAINER/conf/*.pem "$BACKUP_DIR/" | |
certbot-auto certonly \ | |
--non-interactive \ | |
--agree-tos \ | |
--email "[email protected]" \ | |
-a webroot \ | |
-w "$PUBLIC_DIR" \ | |
--rsa-key-size 4096 \ | |
--csr "$CONTAINER/conf/csr.pem" \ | |
--domain "$DOMAIN" \ | |
--cert-path "$CONTAINER/conf/cert.pem" \ | |
--chain-path "$CONTAINER/conf/chain.pem" \ | |
--fullchain-path "$CONTAINER/conf/fullchain.pem" && | |
nginx -t && | |
nginx -s reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment