Created
October 11, 2021 17:12
-
-
Save aardbol/3bdfab948c61f9968f11db124aeac8cd to your computer and use it in GitHub Desktop.
Let's Encrypt certificate generation with OVH DNS & Nginx
This file contains hidden or 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 | |
# Assuming you've configured your nginx config: | |
# ssl_certificate /etc/letsencrypt/live/[domain]/fullchain.pem; | |
# ssl_certificate_key /etc/letsencrypt/live/[domain]/privkey.pem; | |
# | |
# Change the variables between [] and add your OVH API keypair | |
export OVH_AK="" | |
export OVH_AS="" | |
# /home/[username]/.acme.sh/[domain] | |
SRC="" | |
# /etc/letsencrypt/live/[domain] | |
DEST="" | |
/home/[username]/.acme.sh/acme.sh --issue --force -d [domain] -d [domain] --dns dns_ovh && \ | |
sudo mv $SRC/[domain].key $DEST/privkey.pem && \ | |
sudo cp $SRC/fullchain.cer $DEST/fullchain.pem && \ | |
sudo chown root:root $DEST/privkey.pem && \ | |
sudo chmod 600 $DEST/privkey.pem && \ | |
sudo systemctl restart nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment