Skip to content

Instantly share code, notes, and snippets.

@aardbol
Created October 11, 2021 17:12
Show Gist options
  • Select an option

  • Save aardbol/3bdfab948c61f9968f11db124aeac8cd to your computer and use it in GitHub Desktop.

Select an option

Save aardbol/3bdfab948c61f9968f11db124aeac8cd to your computer and use it in GitHub Desktop.

Revisions

  1. aardbol created this gist Oct 11, 2021.
    22 changes: 22 additions & 0 deletions renewcert.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    #!/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