Skip to content

Instantly share code, notes, and snippets.

@lsde
Last active August 19, 2019 22:51
Show Gist options
  • Save lsde/3b191f3fec40242ef877bb458c300325 to your computer and use it in GitHub Desktop.
Save lsde/3b191f3fec40242ef877bb458c300325 to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
# Assuming following config in HAproxy:
#
# acl letsencrypt-acl path_beg /.well-known/acme-challenge/
# use_backend letsencrypt-backend if letsencrypt-acl
# backend letsencrypt-backend
# server letsencrypt 127.0.0.1:8888
DEPLOY_HAPROXY_RELOAD="/etc/init.d/haproxy reload"
for DOMAIN in $@; do
DOMAINS="$DOMAINS -d $DOMAIN"
done
acme.sh --issue --standalone --httpport 8888 --local-address 127.0.0.1 --listen-v4 $DOMAINS
acme.sh --deploy --deploy-hook haproxy -d $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment