Skip to content

Instantly share code, notes, and snippets.

@petrknap
Last active October 24, 2019 07:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petrknap/9160388322ee3d47a94755135b544a3d to your computer and use it in GitHub Desktop.
Save petrknap/9160388322ee3d47a94755135b544a3d to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
#
# Don't forget to:
# 1. make `/etc/letsencrypt` persistent
# 2. share `/tmp/letsencrypt` as `http://example.com/.well-known`
#
set -e
set -x
which certbot-auto || (
curl -SL -o /tmp/certbot-auto https://dl.eff.org/certbot-auto
mv /tmp/certbot-auto /usr/local/bin/certbot-auto
chown root /usr/local/bin/certbot-auto
chmod 0755 /usr/local/bin/certbot-auto
)
mkdir /tmp/letsencrypt || true
/usr/local/bin/certbot-auto certonly \
--non-interactive \
--webroot \
--webroot-path /tmp/letsencrypt \
--agree-tos \
--register-unsafely-without-email\
$*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment