Browse Source

Add actual script

master
brandon 4 months ago
parent
commit
eded122b40
1 changed files with 17 additions and 0 deletions
  1. +17
    -0
      le-renewcert-dodns.sh

+ 17
- 0
le-renewcert-dodns.sh View File

@@ -0,0 +1,17 @@
#!/bin/bash

#Change separator to newline instead of space or period
IFS=$'\n'

for i in `cat $1`;
do
#Works for existing and new domains
certbot certonly --server https://acme-v02.api.letsencrypt.org/directory --dns-digitalocean --dns-digitalocean-credentials $3 -d $i
#Copy cert files to dockeruser certs folder
cp /etc/letsencrypt/live/$i/fullchain.pem /home/$2/certs/$i.crt
cp /etc/letsencrypt/live/$i/privkey.pem /home/$2/certs/$i.key
done

#Bring down and back up nginx-proxy to use newly copied certs
docker-compose -f /home/$2/docker-compose.yml rm -fsv $4
docker-compose -f /home/$2/docker-compose.yml up -d $4

Loading…
Cancel
Save