Skip to content

Instantly share code, notes, and snippets.

@RNCTX
Created September 28, 2019 20:49
Show Gist options
  • Select an option

  • Save RNCTX/3e04bbcb06b26818cc62a132964aa46d to your computer and use it in GitHub Desktop.

Select an option

Save RNCTX/3e04bbcb06b26818cc62a132964aa46d to your computer and use it in GitHub Desktop.
DD-WRT letsencrypt renewal script.
#!/bin/sh
export PATH=/opt/bin:/opt/sbin:$PATH
mount -o remount,rw /opt
rm -f /tmp/root/acme.log
/opt/etc/init.d/S80nginx stop
acme.sh --renew --ca-path /opt/etc/ssl/certs --cert-home /opt/etc/ssl --home /opt/root/.acme --log /tmp/root/acme.log -d '*.DOMAIN.NET' --dns dns_aws --ecc
acme.sh --install-cert --ca-path /opt/etc/ssl/certs --cert-home /opt/etc/ssl --home /opt/root/.acme --log /tmp/root/acme.log -d '*.DOMAIN.NET' --ecc \
--cert-file '/opt/etc/ssl/pem/*.DOMAIN.NET/cert.pem' \
--key-file '/opt/etc/ssl/pem/*.DOMAIN.NET/key.pem' \
--fullchain-file '/opt/etc/ssl/pem/*.DOMAIN.NET/fullchain.pem'
mount -o remount,ro /opt
/opt/etc/init.d/S80nginx start
BODY=$(cat /tmp/root/acme.log)
echo -e "Subject: [dd-wrt] SSL Key Renewal Output\nContent-Type: text/plain; charset=utf-8\nMime-Version: 1.0\n\n$BODY\n\n" | msmtp -C /opt/etc/msmtprc USER@gmail.com
exit 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment