Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Snippent to configure Zentyal with Let's encrypt certificate using DNS challenge
#!/bin/bash
# Snippent to configure Zentyal with Let's encrypt certificate using DNS challenge
# Run as root, acme.sh doesn't like sudo
# GoDaddy API key
set GD_Secret=""
set GD_Key=""
set ACCOUNT_EMAIL=""
set HOST_FQDN=""
apt install -y git socat
cd /tmp
git clone https://github.com/Neilpang/acme.sh.git
cd ./acme.sh
mkdir /etc/acme.sh
./acme.sh --install --home /etc/acme.sh --accountemail ${ACCOUNT_EMAIL}
/etc/acme.sh/acme.sh --issue -d ${HOST_FQDN} --dns dns_gd --home /etc/acme.sh/
/etc/acme.sh/acme.sh --install-cert -d ${HOST_FQDN} --home /etc/acme.sh/ --reloadcmd "cat /etc/acme.sh/${HOST_FQDN}/${HOST_FQDN}.cer /etc/acme.sh/${HOST_FQDN}/${HOST_FQDN}.key > /var/lib/zentyal/conf/ssl/ssl.pem && systemctl restart zentyal.webadmin-nginx.service"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment