ansible-role-certbot/files/etc/letsencrypt/lexicon-gandi.sh
2018-10-08 19:35:07 +02:00

22 lines
515 B
Bash
Executable file

#!/bin/bash
. /etc/letsencrypt/gandi-api-keys
if [ "$1" != "list" ]; then
NAME_VALUE="_acme-challenge.${CERTBOT_DOMAIN}"
CONTENT_VALUE="${CERTBOT_VALIDATION}"
else
NAME_VALUE=""
CONTENT_VALUE=""
fi
/usr/bin/lexicon gandi \
--auth-token="${AUTH_TOKEN}" \
--name "${NAME_VALUE}" \
--content "${CONTENT_VALUE}" \
"$1" "${CERTBOT_DOMAIN}" TXT \
|| exit 255
if [ "$1" == "create" ]; then
sleep 1500
fi