Skip to content

Instantly share code, notes, and snippets.

@qubbit
Created April 6, 2018 04:24
Show Gist options
  • Save qubbit/e782b248a58df18afdb1c8cc08269111 to your computer and use it in GitHub Desktop.
Save qubbit/e782b248a58df18afdb1c8cc08269111 to your computer and use it in GitHub Desktop.

Revisions

  1. Gopal Adhikari created this gist Apr 6, 2018.
    19 changes: 19 additions & 0 deletions renew_certs.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #!/usr/bin/env bash

    RENEWAL_STATUS=$(certbot-auto certonly \
    -d 'domain.com,sub.domain.com' \
    --nginx \
    -n \
    --expand
    )

    curl -s --user 'api:key-MAILGUN_API_KEY' \
    https://api.mailgun.net/v3/domain.com/messages \
    -F from='Snow White <[email protected]>' \
    -F [email protected] \
    -F subject='SSL Certificates Renewed!' \
    -F text="$RENEWAL_STATUS"


    # mv renew_certs.sh /etc/cron.monthly